record delimiter problems
Moderators: chulett, rschirm, roy
record delimiter problems
I have a variable length file and I am using a parallel reader as an input stage for the variable length file. It is a must to specify the record delimiter within this stage.
Now I do not have a record delimiter as none of the records have a newline at the end of the record. What should my record delimiter be as I have tried null and none. I am out of ideas. Please help me.
Now I do not have a record delimiter as none of the records have a newline at the end of the record. What should my record delimiter be as I have tried null and none. I am out of ideas. Please help me.
ps
-
- Premium Member
- Posts: 397
- Joined: Wed Apr 12, 2006 2:28 pm
- Location: Tennesse
-
- Premium Member
- Posts: 209
- Joined: Fri Jan 09, 2004 1:14 pm
- Location: Toronto, Canada
- Contact:
Re: record delimiter problems
What character(s) are used to distinguish the different records in your file? I.e. when you open your file with a text editor, how do you know when the first record ends and the second one starts?psriva wrote:Now I do not have a record delimiter as none of the records have a newline at the end of the record. What should my record delimiter be as I have tried null and none. I am out of ideas. Please help me.
Rob W
Rob Wierdsma
Toronto, Canada
bartonbishop.com
Toronto, Canada
bartonbishop.com
Pipe delimited.
Now when I specify the record delimiter as pipe (|), I get another error on one of the field saying " Delimiter for field 'name' not found".
Th following is my record schema:
record
{final_delim=none,delim='|',charset='ISO8859-1'}
(
account:string[max=10] {default='0'};
name:string[max=10] {default='a'};
location:string[max=10] ;
)
And below is the data file:
104246|abc|usa|104247|def|uk|104250|ghi|india|
Please help me write the right schema for this.
Now when I specify the record delimiter as pipe (|), I get another error on one of the field saying " Delimiter for field 'name' not found".
Th following is my record schema:
record
{final_delim=none,delim='|',charset='ISO8859-1'}
(
account:string[max=10] {default='0'};
name:string[max=10] {default='a'};
location:string[max=10] ;
)
And below is the data file:
104246|abc|usa|104247|def|uk|104250|ghi|india|
Please help me write the right schema for this.
ps
Code: Select all
104246|abc|usa|104247|def|uk|104250|ghi|india|
Kris
Where's the "Any" key?-Homer Simpson
Where's the "Any" key?-Homer Simpson
-
- Charter Member
- Posts: 560
- Joined: Wed Jul 13, 2005 5:36 am
- Location: Ohio
This data has '|' both as field delimiter and record delimiter. Can you try and correct the data? change record delimiter to a line termination character after location. something like:psriva wrote:Pipe delimited.
Now when I specify the record delimiter as pipe (|), I get another error on one of the field saying " Delimiter for field 'name' not found".
Th following is my record schema:
record
{final_delim=none,delim='|',charset='ISO8859-1'}
(
account:string[max=10] {default='0'};
name:string[max=10] {default='a'};
location:string[max=10] ;
)
And below is the data file:
104246|abc|usa|104246|abc|usa|104246|abc|usa|
Please help me write the right schema for this.
104246|abc|usa
104246|abc|usa
You cannot read the data in the esixting format.
104246|abc|usa
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There is no such thing as the "parallel reader" stage. I presume that you are using a Sequential File stage.
If your data have no line terminators then each row must be of the same length or of a known length described in the data. Otherwise there is no way that any utility can accurately read the data.
Have you tried setting the Final Delimiter property (not the same as the Record Delimiter property)?
If your data have no line terminators then each row must be of the same length or of a known length described in the data. Otherwise there is no way that any utility can accurately read the data.
Have you tried setting the Final Delimiter property (not the same as the Record Delimiter property)?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
That was vital information omitted from your original post. I can only suggest close scrutiny of that stage's source code to determine how records of this type ought to be handled.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.