View previous topic :: View next topic
|
Author |
Message |
pshongal
New User
Joined: 14 Jun 2012 Posts: 96 Location: India
|
|
|
|
Hi,
I have a file (FB). But value in each field can have variable length (like name, address etc). I need a O/P with pipe delimited.
I/P:
Code: |
fname1 addr1 city1
fname11 addr11 city11
fname111 addr111 city111
|
Required O/P:
Code: |
fname1|addr1|city1
fname11|addr11|city11
fname111|addr111|city111
|
Thanks,
PS[/code] |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Quote: |
I have a file (FB) |
No you do not - you have a data set. |
|
Back to top |
|
|
pshongal
New User
Joined: 14 Jun 2012 Posts: 96 Location: India
|
|
|
|
Yes. Data set |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
You have provided very less information to help. What is the Input/Output record format & record length. What could be the maximum length of any field. Your data might have embedded spaces in name/address fields like:
Code: |
First Name Last Name ABC ROAD NEW DELHI |
Search using key words PARSE, BUILD, SHIFT, SQZ. You will find many examples to start with. |
|
Back to top |
|
|
pshongal
New User
Joined: 14 Jun 2012 Posts: 96 Location: India
|
|
|
|
Hi,
Here is some more information.
I/P & O/P record format is "FB"
record length is 310 bites
Code: |
Field Max length
First name 30
Address 250
City 30
|
|
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
So the Address filed will always start at col 31 and City will always start from col 281?
Name/Address/City fields can have spaces in them? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
It is as simple as making a tea. You would have to search on what Mistah suggested and TRY and next time try to provide the least minimal information to the problem together when you post than feeding a piece meal. |
|
Back to top |
|
|
|