Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove all double quotes form text file 1

Status
Not open for further replies.

Sammy145

Programmer
Oct 4, 2002
173
GB
I want to remove all double quotes from CSV
example data

"field1","Field2",3,5,"abc"
"field4","Field8",3,5,"abttrec"
"field5","Field6",3,5,"abterc"


Can someone give me some sample code to do this the file can have a few thousand lines

thanks for all your help

Sam
 
You can do this with a straight Replace or through the use of a Regular expression. Be aware that this will possibly break your CSV.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
what do u mean EBGreen when u say "Be aware that this will possibly break your CSV. " how so
 
I mean that if you have a field that has a comma in the data that is contained in the field, then if you remove the ""s the data will not import properly anymore since it will see the comma that was in the data as a field sepperator now.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top