Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

move word from front to back and add a comma and space 1

Status
Not open for further replies.

borisbe

Technical User
Aug 15, 2005
73
US
Working with a csv file in Crystal 9.

We have titles in the csv file. Just a few examples:

1. Beginning Yoga
2. Beg Yoga (Beg short for Beginning)
3. Advanced Yoga
4. Intermediate Yoga
5. Intrm Yoga (Intrm short for Intermediate)
6. Intermediate Pilates

Is it possible to move the first word to the end of the title, add a comma and space before it and remove the space that was before the first word and the second word? Example:

The first two to show as "Yoga, Beginning"
The third one to show as "Yoga, Advanced"
The fourth and fifth to show as "Yoga, Intermediate"
The sixth one to show as "Pilates, Intermediate"

I don't know if this matters but when the class is over then it is no longer in the most current csv file. Example:

If the class with the title "Beg Yoga" ended yesterday then it won't be in today's csv file.

Help is very appreciated.

Thank you
 
stringvar array x := split({table.title}," ");
stringvar y := "";
if x[1] like "Beg*" then
y := "Beginning" else
if x[1] like "Int*" then
y := "Intermediate" else
if x[1] like "Acv*" then
y := "Advanced";
x[2]+", "+y

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top