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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AT Command /

Status
Not open for further replies.

EBOUGHEY

Programmer
Aug 20, 2002
143
0
0
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.... ie:(SERVICE 37.CSV, SERVICE 21.CSV)
 
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~
 
How about:

REPL ALL KEY with RIGHT( forceExt(ORIGIN,''), 2 )

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
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~
 
Have you thought about using RAT() instead?

Regards,

Mike
 
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!"

 
Thanks soooo much everyone. Most of these worked like a charm!

Elena
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top