Determining file delimiter

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
san_dwh
Participant
Posts: 17
Joined: Tue Dec 28, 2010 9:05 am
Location: hyd

Determining file delimiter

Post by san_dwh »

I have a text file in unix box. i dont know which field delemeter is used. how to find out delemeter used and how many colomns are there?.

Please help me
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Re: hi

Post by samyamkrishna »

did you try opening the file and checking
Abhijeet1980
Participant
Posts: 81
Joined: Tue Aug 15, 2006 8:31 am
Location: Zürich
Contact:

Post by Abhijeet1980 »

Dear san,

Firstly, no text file is delimited even if we call it a delimited file.

Lastly, this point is very important to understand.
Delimiter is readers way of parsing the text contained within by assuming a delimiter.

e.g. For argument sake, let us take the following
A,B,C
E,B,G
1,B,3
7,B,9

Anybody, with some prliminary knowledge can say this is a comma separated file.

1. If this file is read with comma as the delimiter, parser shall produce 3 fields.
2. If the same file is read with B as the delimiter, parser shall produce 2 fields.

I hope, you understand.

Kind regards,
Abhijit Gaikwad
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Determining file delimiter

Post by chulett »

san_dwh wrote:how to find out delemeter used and how many colomns are there?
Two basic ways:

1. As noted, use 'vi' to open it up and look at it. Or 'head -10' perhaps.
2. Ask whomever produced and/or sent the file to you.

The second way will be more important if the file has no 'header' record.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

By inspection alone you can not answer this question. You need the metadata. This should be able to be obtained from whoever created the file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply