Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Text to columns function in Crystal Post Reply Post New Topic
Author Message
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Topic: Text to columns function in Crystal
     Posted: 01 Jul 2014 at 6:26am
Hi,
I am using Crystal 2008. I need to strip out the manager's last name, first name and middle initial from the following path as it appears next to the .xlsx:
Q:\Path1\Path2\Path3\Path4\Jones, Bob J\Path5\Path6\Jones, Bob J.xlsx
 
Once I have it stripped, I plan to use it as a group in my Crystal Report.
 
Suggestions on how to strip this out strip this out woudl be appreciated. Thanks!
Smile
 
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 01 Jul 2014 at 11:03am
I cannot open the link to the  XLSX.  But normally you use the left, mid and right functions to strip out parts of the name.
IP IP Logged
thummel1
Senior Member
Senior Member
Avatar

Joined: 27 Apr 2012
Location: United States
Online Status: Offline
Posts: 140
Quote thummel1 Replybullet Posted: 02 Jul 2014 at 1:37am
Sorry, they were not meant to be links. I thought in that function you needed to know how many character lengths to go to the right or to the left. In this case, where the character length for the last section starts will be different for everyone, since the managers name is part of the path name (appears after path 5). I was hoping there would  be some formula that could possibly isolate for anything between the Q: and the last \ and delete it?. Then I'd eventually remove the .xlsx as well.
"Press any key to continue. Where's the 'Any' Key?" ~Homer Simpson
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Jul 2014 at 3:57am
//lastname
stringvar lname;
lname := split({field},"\")[9];
lname := split(lname,",")[1];
lname;
//firstname
stringvar fname;
fname := split({field},"\")[9];
fname := split(fname,",")[2];
fname := split(fname,".")[1];
fname := split(fname," ")[2];
fname;
 
//Middlename
stringvar mname;
mname := split({field},"\")[9];
mname := split(mname,",")[2];
mname := split(mname,".")[1];
mname := split(mname," ")[3];
mname;
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum