Sep 1, 2005 #1 EBOUGHEY Programmer Joined Aug 20, 2002 Messages 143 Location US I am trying to pull the 2 characters to the left of ".CSV" Here is the code I have, but it's not working. Please HELP! Thanks Elena REPL ALL KEY with LEFT(ORIGIN,2 at('.CSV',ORIGIN)) Number value changes.... ieSERVICE 37.CSV, SERVICE 21.CSV)
I am trying to pull the 2 characters to the left of ".CSV" Here is the code I have, but it's not working. Please HELP! Thanks Elena REPL ALL KEY with LEFT(ORIGIN,2 at('.CSV',ORIGIN)) Number value changes.... ieSERVICE 37.CSV, SERVICE 21.CSV)
Sep 1, 2005 #2 thatguy Programmer Joined Aug 1, 2001 Messages 283 Location US how about something like this: Code: replace all key with (SUBSTR(ORIGIN,AT('.csv',ORIGIN)-2,2)) or if you know that the filename is always going to be two digits, then just use: Code: replace all key with (LEFT(ORIGIN,2)) hth -- frank~ Upvote 0 Downvote
how about something like this: Code: replace all key with (SUBSTR(ORIGIN,AT('.csv',ORIGIN)-2,2)) or if you know that the filename is always going to be two digits, then just use: Code: replace all key with (LEFT(ORIGIN,2)) hth -- frank~
Sep 1, 2005 #3 wgcs Programmer Joined Mar 31, 2002 Messages 2,056 Location EC How about: REPL ALL KEY with RIGHT( forceExt(ORIGIN,''), 2 ) - Bill Get the best answers to your questions -- See FAQ481-4875. Upvote 0 Downvote
How about: REPL ALL KEY with RIGHT( forceExt(ORIGIN,''), 2 ) - Bill Get the best answers to your questions -- See FAQ481-4875.
Sep 1, 2005 #4 thatguy Programmer Joined Aug 1, 2001 Messages 283 Location US oh oops.. i guess i skimmed over the fact that the filenames were in the format (SERVICE xx.CSV).. then the LEFT() function wouldn't work too well.. could also use: Code: replace all key with (RIGHT(JUSTSTEM(ORIGIN),2)) -- frank~ Upvote 0 Downvote
oh oops.. i guess i skimmed over the fact that the filenames were in the format (SERVICE xx.CSV).. then the LEFT() function wouldn't work too well.. could also use: Code: replace all key with (RIGHT(JUSTSTEM(ORIGIN),2)) -- frank~
Sep 2, 2005 #5 mspratt Programmer Joined Mar 24, 2004 Messages 597 Location US Have you thought about using RAT() instead? Regards, Mike Upvote 0 Downvote
Sep 2, 2005 #6 mmerlinn Programmer Joined May 20, 2005 Messages 766 Location US Here are two different ways you could do this: Use RIGHT(LEFT(ORIGIN, AT('.CSV', ORIGIN) - 1), 2) or the way I would do it: RIGHT(ATXLEFT(ORIGIN, '.CSV'), 2) See FAQ182-5975 for the code for the ATXLEFT() UDF.? mmerlinn "Political correctness is the BADGE of a COWARD!" Upvote 0 Downvote
Here are two different ways you could do this: Use RIGHT(LEFT(ORIGIN, AT('.CSV', ORIGIN) - 1), 2) or the way I would do it: RIGHT(ATXLEFT(ORIGIN, '.CSV'), 2) See FAQ182-5975 for the code for the ATXLEFT() UDF.? mmerlinn "Political correctness is the BADGE of a COWARD!"
Sep 2, 2005 Thread starter #7 EBOUGHEY Programmer Joined Aug 20, 2002 Messages 143 Location US Thanks soooo much everyone. Most of these worked like a charm! Elena Upvote 0 Downvote
Sep 2, 2005 #8 SBTBILL Programmer Joined May 1, 2000 Messages 515 Location US Remember the AT function returns the location so if you want to be after it you need to add 1, to state the obvious. Bill Couture http://www.sbtbill.com Upvote 0 Downvote
Remember the AT function returns the location so if you want to be after it you need to add 1, to state the obvious. Bill Couture http://www.sbtbill.com