View previous topic :: View next topic
|
Author |
Message |
umed
New User
Joined: 13 May 2005 Posts: 38
|
|
|
|
Hi,
I am having input file which is a comma delimited. Same file can have multiple records in one line. I need to separate these records and write into one output file with fixed format. How can we do that?
e.g.
INPUT File :
Field1,field2,feild3 file1,file2,file3 field1,field2,field3 field1,
field2,field3
Note that 2 records are not separated by comma but they are separated by space.
I want output file in below mentioned format :
field1 field2 field3
field1 field2 field3
field1 field2 field3
Here output files lay out is fixed .
e.g. Field1 1-10
field2 12-20
field3 21-30
Can anyone help me to achieve this using sort.
Regards,
Umed |
|
Back to top |
|
|
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 194 Location: India
|
|
|
|
I am looking for similar requirement but only comma some thing like CSV file as input.
I got as SORT can achieve this using OUTFIL PARSE statements but still working on it.
Please try and let me know if you do.. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Umed,
Your description of the requirement is very confusing. It's not clear what variations in the layout of the records you can have (maximum length of a field, maximum number of fields in a record, are there only two records or can there be more, etc). It's not clear how the fields separated by blanks fit in or what you want to do with them. Since you used Field1, Field2 and Field3 multiple times, it's impossible to distinguish between them in the input or output.
Please show an example with non-generic values (e.g. ABCDEF,GHI) and explain the possible variations and the "rules" for dealing with them.
Quote: |
Note that 2 records are not separated by comma but they are separated by space. |
Huh? Do you mean "2 fields are not separated ..."? There's a big difference between records and fields and when you use incorrect terminology like this, it makes it very difficult to understand what you want. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Srini,
Please start a new topic and explain clearly what it is you want to do. |
|
Back to top |
|
|
|