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
Determining file delimiter
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 258
- Joined: Tue Jul 04, 2006 10:35 pm
- Location: Toronto
Re: hi
did you try opening the file and checking
-
- Participant
- Posts: 81
- Joined: Tue Aug 15, 2006 8:31 am
- Location: Zürich
- Contact:
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
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
Re: Determining file delimiter
Two basic ways:san_dwh wrote:how to find out delemeter used and how many colomns are there?
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
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: