Delimiter Issue in extracting file
Moderators: chulett, rschirm, roy
Delimiter Issue in extracting file
Hi All,
We have a scenario as below:
Source file:
"1","AAA","BBB","CCC"
"2","AA",A","BBB","CCC"
In the above records the 1st record wil be processed succesfully if we set " and , as delimiter in the sequential file stage but for the second record we have both double quotes(") and comma(,) in the data in 2nd column (highlighted in green), so the record will be dropped. Is there any way to fetch these kind of records through DS job?? I have tried by making either " or , as delimiter, but in both cases the data is truncated or dropped. Kindly requesting ur help fr solving this.
We have a scenario as below:
Source file:
"1","AAA","BBB","CCC"
"2","AA",A","BBB","CCC"
In the above records the 1st record wil be processed succesfully if we set " and , as delimiter in the sequential file stage but for the second record we have both double quotes(") and comma(,) in the data in 2nd column (highlighted in green), so the record will be dropped. Is there any way to fetch these kind of records through DS job?? I have tried by making either " or , as delimiter, but in both cases the data is truncated or dropped. Kindly requesting ur help fr solving this.
Thanks,
Sajeev N
Sajeev N
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 91
- Joined: Wed Apr 20, 2005 7:59 pm
- Location: U.S.
@Ray
Ray,
The is generated from CDC when there is an update or insert in source DB2 table. By default the CDC will create files with comma(,) & double quotes(") as delimiter. Is there any way to change the delimiter in CDC?
The is generated from CDC when there is an update or insert in source DB2 table. By default the CDC will create files with comma(,) & double quotes(") as delimiter. Is there any way to change the delimiter in CDC?
Thanks,
Sajeev N
Sajeev N
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 21
- Joined: Fri Oct 01, 2010 2:45 pm
- Contact:
We used a preprocess shell script to strip unwanted newlines
Some of our data was apparently coming from web forms with free-form text fields that weren't being sanitized. A shell script was used to parse the file and locate extraneous newlines beforehand. The same approach could be used in this case to locate errant quote characters.
@ mobashshar
Thanks mobashshar for the information.
We have fixed this issue by changing the delimiter to pipe(|) from CDC. We have created a PMR with IBM and they provided a java program to change the delimiter to pipe while generating files from CDC. Now its working fine.
Thanks for all your help. !!
We have fixed this issue by changing the delimiter to pipe(|) from CDC. We have created a PMR with IBM and they provided a java program to change the delimiter to pipe while generating files from CDC. Now its working fine.
Thanks for all your help. !!
Thanks,
Sajeev N
Sajeev N