Page 1 of 1

Reading two different delimeters in a single flat file

Posted: Tue Feb 15, 2011 10:56 pm
by manu.dwhds
HI ,
Please any body let me know how to read two diffrent delimters conatines single file like (Ex:my flat file containes Pipe and comma).
Please suggest using which stage we can perform this reading opeartion .

Posted: Tue Feb 15, 2011 11:01 pm
by chulett
First suggestion, post in the correct forum based on your job type. I guessed PX, 8.x and UNIX so moved it here. If that's not right please go back and edit your post so that it is correct.

Posted: Tue Feb 15, 2011 11:10 pm
by manu.dwhds
Thanks for reply,
I have flat file it containes data few of the rows as comma delimter and few of the data as pipe delimeter when i read using sequntial file stage its not reading properly ,please let me know how to set the property in sequntial file stage.

Posted: Wed Feb 16, 2011 12:16 am
by myukassign
Option 1
----------
Read the file using sequential file stage with delimiter comma.

Then use a following column import stage, there you can specify pipe as a delimiter to further split into columns

Option 2
----------

Read the file with just one column of length varchar 500 or something 1.e. read line by line

Decalre one stage variable where you can replace all pipes with comma, or all comma with pipe to make the delimiter uniform using convert function.

Now you know what to do, you can extract columns using Field / substring function.

split the column in the transformer with Field functions, you need to do it carefully not to missout any columns.

Posted: Wed Feb 16, 2011 1:04 am
by manu.dwhds
Thanks for your quick reply