Removing CSV quotations from csv files in directory

tdignan87

Well-known member
Joined
Jul 8, 2019
Messages
95
Programming Experience
Beginner
Hi there,
Does anyone have any code examples of removing quotations from CSV files in a directory? I can only find on Google; how to remove them from specific CSV files and not all CSV files within that folder.
Example of CSV with quotations:
"B0517","B900300005","2019-01-31","B1-5-B",175.000

I need the file to be
B0517,B900300005,2019-01-31,B1-5-B,175.000

Our ERP system can only export with quotations and our new traceability system can only accept them without!. I am hoping to create a simple program that will look up CSV files in the specified directory, and remove the "". The file will then be moved to another folder.

Is there a simple way of doing this? If somebody could help me I would really appreciate it!.
 
And to deal with all files in a folder, use the Directory.GetFiles() or DirectoryInfo.GetFiles() classes to enumerate files, and then apply the procedure above. You can likely do a sniff test by checking the first 4096 characters of the file contents to see if there are quotes in there or not. No need to modify files if you don't need to.
 
Back
Top Bottom