View previous topic :: View next topic
|
Author |
Message |
amit_tater
New User
Joined: 22 Dec 2006 Posts: 9 Location: Indore
|
|
|
|
I have a file with record as
001 LNAME1, FNAME1 FNAME2 P.O.BOX 00
002 LNAME2, FILEN P P.O.BOX 01
I want to separate the name fields in such a way that the First name, last name, middle name and middle initial should be populated in position 5, 25, 45 and 60th position of output file respectively. First name and last name are separated by ',' . last name and middle name are separated by a space. If middle name is of one character then it will be treated as middle initial otherwise it will be treated as middle name.
The output will look like
001 LNAME1 FNAME1 FNAME2 P.O.BOX52
002 LNAME2 FILEN P P.O.BOX86
INput File is a FB with record length as 200. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Also you wanted to replace ',' by space and P.O.BOX 00 to P.O.BOX52 and
P.O.BOX 01 to P.O.BOX86?
Please clarify better |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
if You had posted the data using the code tags, everything would have been more clear...
the code tags preserve the spacing
without ...
1234567890
>> <<
with
as posted the information provided is completely useless |
|
Back to top |
|
|
amit_tater
New User
Joined: 22 Dec 2006 Posts: 9 Location: Indore
|
|
|
|
for example
Code: |
001 JAMES, KLEN CARTER P.O.BOX 52
002 AARON,FILEN P P.O.BOX 86
|
output expected
Code: |
001 JAMES KLEN CARTER P.O.BOX52
002 AARON FILEN P P.O.BOX86 |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
How is this so similar to this one?
Anyway, for the data in variable positions, you use PARSE.
If you want to know of a single initial, test for space after the first byte. |
|
Back to top |
|
|
|