View previous topic :: View next topic
|
Author |
Message |
harunnisa
New User
Joined: 27 Aug 2008 Posts: 8 Location: Chennai
|
|
|
|
I have i/p in the following format:
MCCLANEY, DARNELLA J
TROMBLEY, ANGELA S.
KETTY SMIT
I want o/p should be:
DARNELLA J MCCLANEY
ANGELA S TROMBLEY
SMITT KETTY
can anyone help on this issue? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
This is a HELP forum, not a DO-YOUR-CODE-FOR-YOU forum. What have you done so far and what is not working about it? |
|
Back to top |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
What's the logic behind the extra 'T' in the sample,
|
|
Back to top |
|
|
Ranjithkumar
New User
Joined: 10 Sep 2008 Posts: 93 Location: India
|
|
|
|
@harunnisa:
1. Replace all balnks by ',' using INSPECT.
2. UNSTRING the value into three variables (L-NAME,F-NAME,M-NAME) delimitted by ','.
3. Use the variables to STRING as per your requirement.
It will work only if the order in input is L-NAME,F-NAME M-NAME and L-NAME and F-NAME should not be blank. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
It will work only if the order in input is L-NAME,F-NAME M-NAME and L-NAME and F-NAME should not be blank. |
You have made a "rule" that conflicts with the sample "input" shown. . .
When posting a "solution", it needs to meet the requirement, not just something similar. . .
This is like having your mechanic tell you "I couldn't fix your brakes so i made your horn louder" - compliments of our Admin |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Quote: |
MCCLANEY, DARNELLA J
TROMBLEY, ANGELA S.
KETTY SMIT |
Ignoring the lack of the extra 'T' and the missing ',' in the last name as just typos, unstring delimited by the comma into last-name and first-middle-name and then string them back together..... |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Standardized entry of names in a fixed order with commas, and periods is often promised by designers and user representatives but seldom delivered in reality. |
|
Back to top |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
CICS Guy wrote: |
Quote: |
MCCLANEY, DARNELLA J
TROMBLEY, ANGELA S.
KETTY SMIT |
Ignoring the lack of the extra 'T' and the missing ',' in the last name as just typos, unstring delimited by the comma into last-name and first-middle-name and then string them back together..... |
Since the owner has not replied to any of our queries i think all we can do is guess...
Basically i think that the three samples provided are three differnet ways the input might come. One with ',' after LAST NAME, another with a '.' in the last of the input, the third with no ',' or '.'. ... |
|
Back to top |
|
|
A_programmers
New User
Joined: 24 Mar 2010 Posts: 19 Location: USA
|
|
|
|
1) Convert all commas to spaces.
2) Extract first word using unstring delimited by space.
3) Append at the end of remaining string. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
A_programmers wrote: |
1) Convert all commas to spaces.
2) Extract first word using unstring delimited by space.
3) Append at the end of remaining string. |
What about people with a multi-part first, middle, or last name?
Or people with no middle name? |
|
Back to top |
|
|
|