I am having trouble with the following task:
At first a new column is added to an existing CSV file that should contain the article price. The new data is saved in a variable with 'CSV Save Data'.
Then I want to read the variable data with 'CSV Data Loop' and extract the article number and a date.
These two information are then used in a SQL query to get the price of the article at the extracted date.
So far the task works and I can show the price in the log.
Then I want to save the price to the new column in the variable with 'CSV Write Cells' and 'CSV Save Data' but the system seems to be in an endless loop when I use the column headers.
After deactivating the column headers I get an additional line between my two initial lines:
I can not figure out what I am doing wrong.
Task:
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|1729260962
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task154"
Hide=INTEGER|0
ID=INTEGER|1167695131
LogOnAsUser=INTEGER|1
Name=STRING|"Copy of toom Preisprotokoll"
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
StepPause=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_CSV_OPEN"
Enabled=INTEGER|-1
Name=STRING|"CSV Open Data"
Params=FOLDER
[Actions\Action1\Params]
commentchars=STRING|"#"
delimiter=STRING|"2"
encoding=STRING|"0"
filename=STRING|"D:\fliesenmax\Protokolle\test2.csv"
headerline=STRING|"0"
linecount=STRING|"0"
quotechar=STRING|"0"
skipcomments=STRING|"0"
skipempty=STRING|"1"
skipfirst=STRING|"0"
source=STRING|"1"
strictdelimiter=STRING|"1"
[Actions\Action10]
ActionID=STRING|"A_CSV_SAVE"
Enabled=INTEGER|-1
Name=STRING|"CSV Save Data"
Params=FOLDER
[Actions\Action10\Params]
_rt_variables_produced=STRING|"CSVDATA"
delimiter=STRING|"2"
notchangeformat=STRING|"1"
quotechar=STRING|"0"
savetofile=STRING|"1"
savetovariable=STRING|"1"
savevariable=STRING|"CSVDATA"
strictdelimiter=STRING|"1"
targetencoding=STRING|"0"
targetfilename=STRING|"D:\fliesenmax\Protokolle\toom_preisprotkoll_neu.csv"
[Actions\Action11]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Actions\Action12]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Actions\Action2]
ActionID=STRING|"A_CSV_ADDCOLUMN"
Enabled=INTEGER|-1
Name=STRING|"CSV Add Column"
Params=FOLDER
[Actions\Action2\Params]
commentchars=STRING|"#"
delimiter=STRING|"2"
encoding=STRING|"0"
fillmode=STRING|"0"
headerline=STRING|"0"
linecount=STRING|"0"
quotechar=STRING|"0"
skipcomments=STRING|"0"
skipempty=STRING|"1"
skipfirst=STRING|"0"
source=STRING|"0"
strictdelimiter=STRING|"1"
totheend=STRING|"1"
[Actions\Action3]
ActionID=STRING|"A_CSV_SAVE"
Enabled=INTEGER|-1
Name=STRING|"CSV Save Data"
Params=FOLDER
[Actions\Action3\Params]
_rt_variables_produced=STRING|"CSVDATA"
delimiter=STRING|"2"
notchangeformat=STRING|"1"
quotechar=STRING|"0"
savetofile=STRING|"0"
savetovariable=STRING|"1"
savevariable=STRING|"CSVDATA"
strictdelimiter=STRING|"1"
targetencoding=STRING|"0"
targetfilename=STRING|"D:\fliesenmax\Protokolle\toom_preisprotkoll_neu.csv"
[Actions\Action4]
ActionID=STRING|"A_CSV_LOOP"
Enabled=INTEGER|-1
Name=STRING|"CSV Data Loop"
Params=FOLDER
[Actions\Action4\Params]
_rt_variables_produced=STRING|"CURROW,ROW"
commentchars=STRING|"#"
conditionmode=STRING|"0"
conditionscount=STRING|"0"
delimiter=STRING|"2"
encoding=STRING|"0"
filename=STRING|"D:\fliesenmax\Protokolle\toom_preisprotkoll.csv"
Format=STRING|"0"
headerline=STRING|"0"
line00000000=STRING|"{CSVDATA}"
linecount=STRING|"1"
linevarname=STRING|"CURROW"
quotechar=STRING|"0"
rowvarname=STRING|"ROW"
skipcomments=STRING|"0"
skipempty=STRING|"1"
skipfirst=STRING|"0"
source=STRING|"2"
strictdelimiter=STRING|"1"
[Actions\Action5]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER
[Actions\Action5\Params]
message=STRING|"{ROW}"
type=STRING|"3"
[Actions\Action6]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER
[Actions\Action6\Params]
message=STRING|"{CURROW(8)}, {CURROW(1)}, {DateTimeToFormat({CURROW(33)},yyyymmdd)}"
type=STRING|"3"
[Actions\Action7]
ActionID=STRING|"A_LOOP_DATASET"
Enabled=INTEGER|-1
Name=STRING|"Dataset Loop"
Params=FOLDER
[Actions\Action7\Params]
_rt_variables_produced=STRING|"DEKPFIELDVALUE"
commatext=STRING|"0"
connectionstring=STRING|"Provider=SQLOLEDB.1;Password=Max2014;Persist Security Info=True;User ID=ViewUser;Initial Catalog=ACLogicDB;Data Source=FLM-SYNLOGIC"
override=STRING|"0"
paramcount=STRING|"2"
password=STRING|""
pname0=STRING|"param1"
pname1=STRING|"param2"
ptype0=STRING|"0"
ptype1=STRING|"0"
pvalue0=STRING|"{CURROW(8)}"
pvalue1=STRING|"{DateTimeToFormat({CURROW(33)},yyyymmdd)}"
sql=STRING|"""SELECT TOP 1 WERTNEU"",""FROM VIEW"",""WHERE ARTIKEL = :param1 AND CONVERT(VARCHAR,DATUM,112) <= :param2"",""ORDER BY DATUM DESC"""
timeout=STRING|"60"
var2=STRING|"DEKPFIELDVALUE"
withmemo=STRING|"1"
[Actions\Action8]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER
[Actions\Action8\Params]
message=STRING|"{DEKPFIELDVALUE(0)}"
type=STRING|"3"
[Actions\Action9]
ActionID=STRING|"A_CSV_WRITECELLS"
Enabled=INTEGER|-1
Name=STRING|"CSV Write Cells"
Params=FOLDER
[Actions\Action9\Params]
cellcount=STRING|"1"
col0=STRING|"34"
commentchars=STRING|"#"
delimiter=STRING|"2"
encoding=STRING|"0"
headerline=STRING|"0"
line00000000=STRING|"{CSVDATA}"
linecount=STRING|"1"
quotechar=STRING|"0"
row0=STRING|"{ROW}"
skipcomments=STRING|"0"
skipempty=STRING|"1"
skipfirst=STRING|"0"
source=STRING|"2"
strictdelimiter=STRING|"1"
val0=STRING|"{DEKPFIELDVALUE(0)}"
[Events]
Event1=FOLDER
[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_GENERAL_SHEDULER"
Name=STRING|"Scheduler(25.10.2024 19:30:00)"
Params=FOLDER
UniqueID=INTEGER|-1782231192
[Events\Event1\Params]
periodicity=STRING|"0"
startdate=STRING|"45590"
time0=STRING|"70200000"
timecount=STRING|"1"
wakeup=STRING|"0"