Convert CSV to Pipe delimited

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
kogads
Premium Member
Premium Member
Posts: 74
Joined: Fri Jun 05, 2009 5:36 pm

Convert CSV to Pipe delimited

Post by kogads »

Hi All,

I want to convert the CSV file to Pipe delimited file

Ex:"aaa","bbb",""Wow!!!" this is good","ddd" to
aaa|bbb|"Wow!!!" this is good|ddd

Experts ideas will really help.
Thanks in advance.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Sequential File stage to read (import) the data using comma as the field delimiter (this is a Format property).

Sequential File stage to write (export) the data using pipe as the field delimiter (again on the Format tab).

Voila!

You have already posted about handling of nested quote characters, so I do not propose to revisit that topic.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Right, simply read it in with one delimiter and write it back out with the other. Have you tried this? What issues are you having?
-craig

"You can never have too many knives" -- Logan Nine Fingers
mayur25
Participant
Posts: 13
Joined: Fri Jul 04, 2008 11:13 pm

Re: Convert CSV to Pipe delimited

Post by mayur25 »

kogads wrote:Hi All,

I want to convert the CSV file to Pipe delimited file

Ex:"aaa","bbb",""Wow!!!" this is good","ddd" to
aaa|bbb|"Wow!!!" this is good|ddd

Experts ideas will really help.
Thanks in advance.
If you already have a file Created then you hae to recreate thorugh Datastage Job.
Seq File Stage ---> Copy ----> Seq File Stage.
In the output go to Format Tab and Choose the Delimiter as Pipe.
If you want quote you can use it or else leave it as is.
If you want to handle Null Handling please Assign Null Value which ever you want.

ou shoul dnot face any issue.
Post Reply