Hello,
I have a problem which i need some assistance in.. basically i have an OCR code that captures some random numbers from the web "OCRArea>694,184,793,218,strText" works perfect it always does the job the captured numbers are stored in a variable "strText" if i use Message>%strText% the numbers in the veriable is displayed correctly.
what i want to do is create a txt file and i need the above variable data in the file name. like the example bellow
Year>yyyy
Midstr>yyyy,3,2,yy
Month>mm
Day>dd
Let>FileName=%profilePath%\Desktop\sample_%strText%_%dd%-%mm%-%yyyy%.txt
WriteLn>FileName,result,strText
for some reason the .txt create option does not work, any assistance is appreciated.
thank you
passing numeric variable in a file name
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1380
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: passing numeric variable in a file name
Use Desktop_dir, like this :
Note that in your example you're using %yyyy% instead of the yy you created with MidStr. So you either don't need the Midstr, or you need to use %yy% instead.
Code: Select all
OCRArea>694,184,793,218,strText
Year>yyyy
Midstr>yyyy,3,2,yy
Month>mm
Day>dd
Let>FileName=%desktop_dir%\sample_%strText%_%dd%-%mm%-%yy%.txt
WriteLn>FileName,result,strText
//Will create ..._10-03-2020.txt
Let>FileName=%desktop_dir%\sample_%strText%_%dd%-%mm%-%yyyy%.txt
//Will create ..._10-03-20.txt
Let>FileName=%desktop_dir%\sample_%strText%_%dd%-%mm%-%yy%.txt
Yes, we have a Custom Scripting Service. Message me or go here