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 .
Reading two different delimeters in a single flat file
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 30
- Joined: Fri Sep 26, 2008 9:33 pm
- Location: Bangalore
Reading two different delimeters in a single flat file
Last edited by manu.dwhds on Tue Feb 15, 2011 11:05 pm, edited 1 time in total.
-
- Participant
- Posts: 30
- Joined: Fri Sep 26, 2008 9:33 pm
- Location: Bangalore
-
- Premium Member
- Posts: 238
- Joined: Fri Jul 25, 2008 8:55 am
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.
----------
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.
Last edited by myukassign on Wed Feb 16, 2011 12:18 am, edited 1 time in total.
-
- Participant
- Posts: 30
- Joined: Fri Sep 26, 2008 9:33 pm
- Location: Bangalore