Stop CSV variable splitting on space
Posted: Wed Apr 27, 2022 4:13 pm
I found the following task on this form for turning CSV values into variables.
E.g. If however, I pass it a CSV containing Sonic, The Hedgehog I get three variables.
It Appears to be splitting on paste why is this and how can I just get
As 2 variables
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|0
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task318"
Hide=INTEGER|0
ID=INTEGER|2024929902
LogOnAsUser=INTEGER|1
Name=STRING|"CSV to variables"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER
[Actions\Action1]
ActionID=STRING|"A_DIALOG_OPEN"
Enabled=INTEGER|-1
Name=STRING|"Open Dialog"
Params=FOLDER
[Actions\Action1\Params]
allowseveral=STRING|"0"
caption=STRING|"Open File"
default=STRING|"None"
filter=STRING|"*.csv"
stopifcancel=STRING|"1"
variable=STRING|"SOURCE"
[Actions\Action10]
ActionID=STRING|"A_LOOP_SIMPLE"
Enabled=INTEGER|-1
Name=STRING|"Simple Loop"
Params=FOLDER
[Actions\Action10\Params]
begin=STRING|"1"
end=STRING|"{sz}"
variable=STRING|"NUM"
[Actions\Action11]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER
[Actions\Action11\Params]
message=STRING|"var{num} = {var{num}}"
type=STRING|"3"
[Actions\Action12]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Actions\Action2]
ActionID=STRING|"A_READ_TXTFILE"
Enabled=INTEGER|-1
Name=STRING|"Read Text File ""{SOURCE}"" (65001)"
Params=FOLDER
[Actions\Action2\Params]
codepage=STRING|"65001"
filename=STRING|"{SOURCE}"
replacenull=STRING|"1"
varname=STRING|"SOURCE"
[Actions\Action3]
ActionID=STRING|"A_TXT_COOMATEXT"
Enabled=INTEGER|-1
Name=STRING|"Comma-separated string -> text"
Params=FOLDER
[Actions\Action3\Params]
kind=STRING|"0"
line00000000=STRING|"{source}"
lines=STRING|"1"
variable=STRING|"txt"
[Actions\Action4]
ActionID=STRING|"A_TXT_NUMBEROFLINES"
Enabled=INTEGER|-1
Name=STRING|"TXT Number of Lines"
Params=FOLDER
[Actions\Action4\Params]
external=STRING|"0"
line00000000=STRING|"{txt}"
linecount=STRING|"1"
variable=STRING|"sz"
[Actions\Action5]
ActionID=STRING|"A_LOOP_SIMPLE"
Enabled=INTEGER|-1
Name=STRING|"Simple Loop"
Params=FOLDER
[Actions\Action5\Params]
begin=STRING|"1"
end=STRING|"{sz}"
variable=STRING|"NUM"
[Actions\Action6]
ActionID=STRING|"A_TXT_EXTRACTLINE"
Enabled=INTEGER|-1
Name=STRING|"TXT Extract Line"
Params=FOLDER
[Actions\Action6\Params]
external=STRING|"0"
line00000000=STRING|"{txt}"
linecount=STRING|"1"
linenum=STRING|"{num}"
variable=STRING|"line"
[Actions\Action7]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""VAR{NUM}"" with value ""{Line}"""
Params=FOLDER
[Actions\Action7\Params]
expand=STRING|"1"
varname=STRING|"VAR{NUM}"
varvalue=STRING|"{Line}"
[Actions\Action8]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Actions\Action9]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER
[Actions\Action9\Params]
message=STRING|"Soutce = {Source}"
type=STRING|"3"
Code: Select all
Sonic
The
Hedgehog
Code: Select all
Sonic
The Hedgehog
Code: Select all
PSA documents created in Microsoft Excel for testing