1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Where to Start with pipe delimited file filtering

Discussion in 'PHP' started by cbryan374, Feb 27, 2010.

  1. cbryan374

    cbryan374 New Member

    Feb 27, 2010
    Likes Received:
    Trophy Points:
    I have a file supplied to me by a vendor in either xml format, or pipe delimited format. What I need to do is read all of the data in and filter out any inactive products. The pipe file in column[18] is where the the product is set to active, either 0,1. Finally I will write the file to a new pipedelimited csv.
    1.) would xml be easier?
    2.) How do I start with this?

    Here is a sample of some data in the pipe file.
    ABC123|ABC name|2.45|Tools||image.jpg|ABC Tool|3.2|||6.99|YES|Great Tool Company|1-ABC123|Yes|02-01-2010|1|

    This is what I want to do:
    skip row 1
    read each row, if active=1 and there is any information in option_type ,write each row to "activewith options.csv"

    then skip row 1,
    read if active=1 and option_type is blank, write each row to "active with out options.csv

Share This Page