I have a flat-file CSV file that is pipe delimited. One field field in particular has multiple data entries, with each of the separate data entries within that field also being separated by the pipe character. That is causing a problem when I'm trying to read the csv file and display it. This is an example of the csv file I"m talking about. I've only included one row, but you can get an idea of what I'm talking about here. 1B7HC13Z3VJ616125|1997|Dodge|"http://api.cdmdata.com/ftproot/DealerFiles/4658/Photos/1B7HC13Z3VJ616125-0.jpg|http://api.cdmdata.com/ftproot/DealerFiles/4658/Photos/1B7HC13Z3VJ616125-1.jpg|http://api.cdmdata.com/ftproot/DealerFiles/4658/Photos/1B7HC13Z3VJ616125-2.jpg|http://api.cdmdata.com/ftproot/DealerFiles/4658/Photos/1B7HC13Z3VJ616125-3.jpg" You'll note I have four fields here. The VIN, Year, Make and then the ImageURLs field -- this fourth field is the one I'm having a problem with. I need to change the pipe characters separating each image url into a comma. And also remove the quotation marks from the start and the end. I need a small php or perl script that will do this for each row and then rewrite a new csv file with the corrections/changes made. If anyone could help with this I would greatly appreciate it. Thanks, Chris
use str_replace() to change "|http" to ",http". you can use the same function to replace all the '"'s to '' (nothing)!