I have a script that gets an input value on each loop. With this value it has to do a certain task. The general task works fine, but at the end of the script it should do the following:
No Errors ==> add the input value to the file "accounts_finished.csv"
ERRORS in process ==> add the input value to the file "ERRORS.csv"
Right now the script writes all input values to both files - which doesn't help me. I can't get it to write to one or the other file depending on the fact if errors occurred or not.
The input values look like this
324
34E2,
JUN3,
07W,
jsje, <---- ERROR for testing
0LC,
0WP,
10J,
1AX,
where no. 5 is an error for sure.
The script looks like this:
Code: Select all
VERSION BUILD=8510617 RECORDER=FX
TAB T=1
TAB CLOSEALLOTHERS
SET !FOLDER_DATASOURCE C:\Users\ABC\Documents\iMacros\Macros\
SET !DATASOURCE Ticker-Symbols_2.csv
SET !DATASOURCE_COLUMNS 1
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
URL GOTO=http://de.finance.yahoo.com/q/hp?s=YHOO
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/q/hp ATTR=ID:pageTicker CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/q/hp ATTR=*
ONDOWNLOAD FOLDER=C:\Users\ABC\Documents\iMacros\Macros\Ergebnisse\ FILE={{!COL1}}_{{!NOW:yyyymmdd}}.csv WAIT=YES
SET !TIMEOUT_STEP 1
SET !ERRORIGNORE YES
TAG POS=1 TYPE=STRONG ATTR=TXT:Aufbereitet<SP>für<SP>Tabellenkalkulationsprogramm
SET !ERRORIGNORE NO
SET !TIMEOUT_STEP 3
Set !extract {{!NOW}}
add !extract {{!COL1}}
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\ABC\Documents\iMacros\Macros\ FILE=accounts_finished.csv
SET !VAR1 EVAL("var x = 1; x;")
Set !extract {{!NOW}}
Set !EXTRACT NULL
ADD !EXTRACT {{!VAR1}}
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\ABC\Documents\iMacros\Macros\ FILE=ERRORS_{{!NOW:yyyymmdd}}.csv