How to Skip PIPE(comes as data) in PIPE Delimited Flat file?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
krantz4bi
Posts: 1
Joined: 12 May 2015 21:16

How to Skip PIPE(comes as data) in PIPE Delimited Flat file?

#1 Post by krantz4bi » 12 May 2015 21:24

Dear All,

I have a problem with a PIPE "|" delimited flat file. I have a column "Description" in which we get a string in which we have PIPE "|" as data. How we can skip this and load it as a data into the column Description. Please help.

Regards,
kranthi.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: How to Skip PIPE(comes as data) in PIPE Delimited Flat f

#2 Post by Squashman » 13 May 2015 06:56

Please provide an example of your data.

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: How to Skip PIPE(comes as data) in PIPE Delimited Flat f

#3 Post by dbenham » 13 May 2015 10:27

You problem is common to CSV files. Originally, the term CSV was restricted to Comma Separated Values. But common usage has expanded the meaning to include nearly any human readable text format with delimited values.

Your specific problem involves a "CSV" file that uses | as the delimiter (instead of a comma)

I have posted a description of difficulties with parsing CSV files, along with a robust and general solution at Safely parse nearly any CSV with parseCSV.bat. Read up on the issues, and see if you can't adapt one of my posted examples to suit your needs. You will need to make sure that you quote any values that contain the delimiter as a literal character.

You can use the "/I:|" option to specify that a pipe is your delimiter.

If you can't figure it out, then you can post an exerpt of an example file that demonstrates your issue(s).


Dave Benham

Post Reply