need help with pipe separated csv files

Discussion in 'PHP' started by yelbom, Jun 2, 2011.

  1. #1
    I need php code to do the following

    I have a bunch of pipe separated csv files that are named liked this

    1file_20100608_6-8-2010.csv
    1file_20100609_6-8-2010.csv
    1file_20100610_6-8-2010.csv

    The pipe delimited lines look like this

    025|0001|ITEMS|0010|619.1000

    For each file, at the beginning of each line, I need to add this part '20100610_6-8-2010' of the file name but also pipe delimited like this '20100610|6-8-2010'

    and then save the file

    The file result of the pipe delimited lines should look look like this
    20100610|6-8-2010|025|0001|ITEMS|0010|619.1000


    Thanks
     
    Last edited: Jun 2, 2011
    yelbom, Jun 2, 2011 IP