Aug-11-2022, 02:00 PM
So ive looked around and found some steps on how to accomplish this, but seem like alot of code for this, maybe im not searching for the right thing, maybe it goes by another name, but i am using pandas and working with CSV and excel files in other scripts..
So here is what i have, just looking for suggestions on the proper or right coding to use to accomplish.
So i have a CSV file that has 4 columns(legit columns)
Date/Time/User/Message
BUT my problem is that if the "Message" string value has their own comma in the value, then the CSV ends up with additional columns.. which then prevents the data from being imported correctly, unless we consolidate those into the main "message" column..
So what im trying to do is save ourselves the manual step of copying over those rare instances of extra columns into the main message column.
Say the CSV has 3000 rows.. and MAYBE about 20 rows have those extra columns.. sometimes the row may only have 1 extra column and other times there may be 5 extra columns for a row..
How can i run a script against this file to check for the extra columns, if found, then copy those column values into the main message column so that we have 1 message string value?
So here is what i have, just looking for suggestions on the proper or right coding to use to accomplish.
So i have a CSV file that has 4 columns(legit columns)
Date/Time/User/Message
BUT my problem is that if the "Message" string value has their own comma in the value, then the CSV ends up with additional columns.. which then prevents the data from being imported correctly, unless we consolidate those into the main "message" column..
So what im trying to do is save ourselves the manual step of copying over those rare instances of extra columns into the main message column.
Say the CSV has 3000 rows.. and MAYBE about 20 rows have those extra columns.. sometimes the row may only have 1 extra column and other times there may be 5 extra columns for a row..
How can i run a script against this file to check for the extra columns, if found, then copy those column values into the main message column so that we have 1 message string value?