View previous topic :: View next topic
|
Author |
Message |
Yugaswaroopini
New User
Joined: 21 Dec 2007 Posts: 10 Location: India
|
|
|
|
Hi All,
My input file has a name field which includes first name, middle name and last name which are separated by "commas(,)".. Please find below for details.
Input file:
**************************
PARIS, AND LILLIAN, et al
MS, AND CARRIE,
SIVAKS, ,
**************************
If there is no middle name and last name, my output file populates the name field as follows.
**************************
CLIENT NAME: SIVAKS, ,
**************************
My question - is there a way to suppress the "comma" in the ouput file?? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Sure. Before you can implement somethng to supress some/all of the commas, the rules must be understood.
You need to set down which commas are to be deleted and which ones are to be retained. Once all of the rules are understood, code can be developed.
As you build "code" for your reuirement, people here will be able to help when there are questions. |
|
Back to top |
|
|
Yugaswaroopini
New User
Joined: 21 Dec 2007 Posts: 10 Location: India
|
|
|
|
Hi,
My expected result should be as follows:
**************************
CLIENT NAME:PARIS, AND LILLIAN, et al
CLIENT NAME:MS, AND CARRIE
CLIENT NAME:SIVAKS
**************************
As per the program logic, a comma is inserted after the first name and before the third name.
->If second name and third name are spaces, there are two commas inserted in the output which needs to be removed in the succeeding sort program.
-> If the third name is spaces, the is a comma inserted after the second name which must be removed in the succeeding sort program.
Note: The name field is of length 150 which includes the first name, second name and last name.
Thanks. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Yugaswaroopini,
I think you can handle this in your program itself rather than doing another pass in SORT to remove the commas. Check the middle names/last names for spaces and process accordingly. |
|
Back to top |
|
|
|