Skip to content
Advertisement

Tag: replace

Import csv: remove filename from column names in first row

I am using Python 3.5. I have several csv files: The csv files are named according to a fixed structure. They have a fixed prefix (always the same) plus a varying filename part: My original csv files look like this: I am manipulating these files using the following code (I am reading the csv files from a source folder and

python re.sub newline multiline dotall

I have this CSV with the next lines written on it (please note the newline /n): I am trying to delete all that commas and putting the address one row up. Thus, on Python I am using this: As far as I know, re.multiline and re.dotall are necessary to fulfill /n needs. I am using re.compile because it is the

Advertisement