Created
July 16, 2023 09:44
-
-
Save exemplum100/238a7939a0334bd2fcae6e29a10520fc to your computer and use it in GitHub Desktop.
Formatting to insert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# data for insert only one column | |
# ex: ('248957'),('248959'),('248960'),('248961'),('248962') | |
x='''248957 | |
248959 | |
248960 | |
248961 | |
248962 | |
248963 | |
248964 | |
552416 | |
''' | |
def formz(x): | |
y=x.rstrip().replace('\n','\'),(\'') # '\n','\',\'' '\n',',' | |
y='(\''+y+'\')' | |
return y | |
with open('SQLinsertval.txt', 'wt') as xfile: | |
xfile.write(formz(x)) | |
xfile.close() | |
print('SQLinsertval.txt done!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment