Creating a Variable to email

Discuss RoboTask here
Post Reply
TWSI
Posts: 22
Joined: Sun Apr 05, 2015 2:01 am

Creating a Variable to email

Post by TWSI »

Hello, when I read a text file *.txt I want to read from line 61 to 150 and create a variable or combined variable that I can use to send this in the body of an email.
these. I also need these spaced 9293*1.............12..............1/2x520" TEFLON TAPE..............E.............0.690 ... represents spaces
example:

9293*1 12 1/2 X 520" TEFLON TAPE E 0.690
1579*1 25 1/8 X 1 1/2 BLK S-40 NIPPLE E 0.866
1652*1 25 1 X CLO BLK S-40 NIPPLE E 0.963
1662*1 12 1 1/4 X CLO BLK S-40 NIPPLE E 1.221
1659*1 4 1 X 5 BLK S-40 NIPPLE E 1.644
1653*1 4 1 X 2 BLK S-40 NIPPLE E 1.059
1633*1 10 1/2 X 2 1/2 BLK S-40 NIPPLE E 0.684
1649*1 6 3/4 X 5 BLK S-40 NIPPLE E 1.257
5348*1 12 1 BLK TEE IMP E 2.940
6500*1 6 1/2 BLK M/STL SQ HD PLUG E 0.554
6520*1 12 1 X 1/8 BLK M/STL HEX BUSH E 3.020
5051*1 8 1 BLK MI ST90 IMP E 2.624
4444*1 6 1 BLK MI 90 IMP E 1.916


Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|726124785
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task1138"
Hide=INTEGER|0
ID=INTEGER|1781971786
LocalVariables=STRING|"attribute="
LogOnAsUser=INTEGER|1
Name=STRING|"Test | read attributes & parse items from file"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER

[Actions\Action1]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"Text Loop"
Params=FOLDER

[Actions\Action1\Params]
destvar=STRING|"ATTRIBUTE"
file=STRING|"C:\sendfile\333333.TXT"
linecount=STRING|"0"
sourcetext=STRING|"0"

[Actions\Action2]
ActionID=STRING|"A_STR_TRIM"
Enabled=INTEGER|-1
Name=STRING|"STR Trim"
Params=FOLDER

[Actions\Action2\Params]
custom=STRING|"0"
eol=STRING|"0"
lead=STRING|"1"
source=STRING|"{attribute}"
spaces=STRING|"1"
tabs=STRING|"1"
trailing=STRING|"1"
variable=STRING|"attribute"

[Actions\Action3]
ActionID=STRING|"A_VARIABLES_DELIMITED"
Enabled=INTEGER|-1
Name=STRING|"Delimit Variable"
Params=FOLDER

[Actions\Action3\Params]
colon=STRING|"0"
comma=STRING|"1"
other=STRING|"0"
otherchar=STRING|"|"
quote=STRING|"0"
semocolon=STRING|"0"
space=STRING|"0"
spaceasone=STRING|"0"
string=STRING|"{attribute}"
tab=STRING|"0"
variable=STRING|"attribute"

[Actions\Action4]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""{attribute}"""
Params=FOLDER

[Actions\Action4\Params]
icon=STRING|"1"
msg0=STRING|"{attribute}"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action5]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Creating a Variable to email

Post by Oleg »

I'm sorry... It seems I don't understand your goal.

Could you pack original file and final text you want to get?
Pack these files into ZIP archive and attach it to your message here.
Oleg Yershov
TWSI
Posts: 22
Joined: Sun Apr 05, 2015 2:01 am

Re: Creating a Variable to email

Post by TWSI »

attached is the tsk file along with the text file.

Starting on line 62 I need to add all of these items in to a body of an email. It can be from 1 item to 100 items but it will always start on line 62, I also need it to be spaced out from left to right so it's not all compressed together.
Attachments
FILES.zip
(1.73 KiB) Downloaded 1367 times
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Creating a Variable to email

Post by Oleg »

Look an my example below.
I hope that this is what you want.

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|317955339
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task1207"
Hide=INTEGER|0
ID=INTEGER|1963888289
LogOnAsUser=INTEGER|1
Name=STRING|"From line 61 to end"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""NUM"" with value ""1"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"NUM"
varvalue=STRING|"1"

[Actions\Action2]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""TEXT"" with value """""
Params=FOLDER

[Actions\Action2\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"TEXT"

[Actions\Action3]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"Text Loop"
Params=FOLDER

[Actions\Action3\Params]
destvar=STRING|"LINE"
file=STRING|"D:\Temp\msg\333333.TXT"
linecount=STRING|"0"
sourcetext=STRING|"0"

[Actions\Action4]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action4\Params]
case=STRING|"0"
operator=STRING|"2"
type=STRING|"1"
value1=STRING|"{num}"
value2=STRING|"61"

[Actions\Action5]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""TEXT"" with value ""{text}{line}{eol}"""
Params=FOLDER

[Actions\Action5\Params]
expand=STRING|"1"
varname=STRING|"TEXT"
varvalue=STRING|"{text}{line}{eol}"

[Actions\Action6]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action7]
ActionID=STRING|"A_VARIABLES_INCREMENT"
Enabled=INTEGER|-1
Name=STRING|"Increment variable ""num"""
Params=FOLDER

[Actions\Action7\Params]
incement=STRING|"1"
vaiable=STRING|"num"

[Actions\Action8]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action9]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""{text}"""
Params=FOLDER

[Actions\Action9\Params]
icon=STRING|"1"
msg0=STRING|"{text}"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

Oleg Yershov
TWSI
Posts: 22
Joined: Sun Apr 05, 2015 2:01 am

Re: Creating a Variable to email

Post by TWSI »

Thanks again!!!
TWSI
Posts: 22
Joined: Sun Apr 05, 2015 2:01 am

Re: Creating a Variable to email

Post by TWSI »

Rather than reading this file 333333.txt how do I change it to read c:\sendfile\*.txt

file=STRING|"D:\Temp\msg\333333.TXT"
Post Reply