Page 1 of 1

record delimiter problems

Posted: Mon Sep 18, 2006 10:40 am
by psriva
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.

Posted: Mon Sep 18, 2006 10:48 am
by samsuf2002
MAY BE U SHOULD TRY FIXED WIDTH OPTION

Posted: Mon Sep 18, 2006 10:54 am
by shaimil
What is the file type?

Do you mean it has a variable record lengths within the same file?

Shai

Re: record delimiter problems

Posted: Mon Sep 18, 2006 11:19 am
by rwierdsm
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.
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?

Rob W

Posted: Mon Sep 18, 2006 11:58 am
by psriva
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.

Posted: Mon Sep 18, 2006 12:06 pm
by kris007

Code: Select all

104246|abc|usa|104247|def|uk|104250|ghi|india| 
If you look at the data and if it is a complete record that you have provided, then you need to set your Final Delimiter as "|"(pipe) which is obvious from the record.

Posted: Mon Sep 18, 2006 2:21 pm
by Krazykoolrohit
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.
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:
104246|abc|usa
104246|abc|usa

You cannot read the data in the esixting format.
104246|abc|usa

Posted: Mon Sep 18, 2006 2:32 pm
by psriva
I tried the same schema with sequential file stage and it runs fine.

Posted: Mon Sep 18, 2006 2:39 pm
by kris007
What was the stage you were using earlier? :?

Posted: Mon Sep 18, 2006 3:13 pm
by psriva
I am using the parallel reader stage currently.

Posted: Mon Sep 18, 2006 6:03 pm
by ray.wurlod
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)?

Posted: Mon Sep 18, 2006 8:43 pm
by psriva
I am using a custom stage developed for use within my company.

Posted: Mon Sep 18, 2006 9:25 pm
by ray.wurlod
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.