Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
stevelord
Specialist
Specialist

parse file name of varying length to make field values

Hi, I have a heap of files named like this lastname_firstname.pdf

Since they are pdfs, I can't load the contents of the files (to my knowledge).  The request is simply for a view of the list of the files so reps can see whose files we've received.  I could just load filename() as filename and sort alphabetically, but I would like to make a couple of clean fields for first name and last name for ocd/tidiness reasons.

I feel like the answer is in my head or on a qvw I have somewhere, but if someone can hit me with the function here real quick it'd save me time rummaging around and get you some easy correct answer credit.   (and be helpful to others with similar questions.)

1 Solution

Accepted Solutions
Not applicable

Hi Steve,

can split based on the _ char.

SubField(filename(),'_',1)      As Firstname

SubField(filename(),'_',2)      As lastname

hope that helps

Joe

View solution in original post

3 Replies
Not applicable

Hi Steve,

can split based on the _ char.

SubField(filename(),'_',1)      As Firstname

SubField(filename(),'_',2)      As lastname

hope that helps

Joe

stevelord
Specialist
Specialist
Author

Thanks, I just found that answer too.   (Subfield() was the name of the function I was drawing a blank on.  Rarely had to use it.)

Not applicable

No problem, glad to help and kudos on the OCD ness, one of my favourite curveball questions to ask in interviews