We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4f065ca + 52767e1 commit db59d5eCopy full SHA for db59d5e
mimic-iv/buildmimic/sqlite/import.py
@@ -17,7 +17,11 @@
17
for f in glob("**/*.csv*", recursive=True):
18
print("Starting processing {}".format(f))
19
folder, filename = os.path.split(f)
20
- tablename = filename.strip(".gz").strip(".csv").lower()
+ tablename = filename.lower()
21
+ if tablename.endswith('.gz'):
22
+ tablename = tablename[:-3]
23
+ if tablename.endswith('.csv'):
24
+ tablename = tablename[:-4]
25
if os.path.getsize(f) < THRESHOLD_SIZE:
26
df = pd.read_csv(f)
27
df.to_sql(tablename, CONNECTION_STRING)
0 commit comments