Problems with initial value of global var
Posted: Sat Aug 09, 2008 1:25 am
Hi,
I like to search big htm-files for certain signalwords, then extract the information that follow-up these signalwords and put them in a form that is friendly for *.csv . I do it using global vars and but there is a problem. It looks like this:
The htm-files look like this:
1.htm
fdskjfhsd
votes
9876
sdfsdf
2.htm
sdfsdf
votes
14323
3.htm
sdfdsgf
asfddsf
asdsa
What I do is:
restrict to lines matching ^votes (with context line 1 After the match)
--> subfilter
capture to variable "votes" ([X] Reset to initial value at start of each file) with the Initial Value .
then I remove all the content of the htm and add a header with the value of votes (@votes). Finally I append everthing in one *.csv
generally this works well, but not so well if textpipe doesnt find "votes", like in 3.htm in my example. then the result is NOT
9876
14323
.
..as I expected it to be but:
9876
14323
14323
..which gives me the impression the RESET doesnt work... what can I do to ensure a proper reset to the initial value?
greetings
S.
I like to search big htm-files for certain signalwords, then extract the information that follow-up these signalwords and put them in a form that is friendly for *.csv . I do it using global vars and but there is a problem. It looks like this:
The htm-files look like this:
1.htm
fdskjfhsd
votes
9876
sdfsdf
2.htm
sdfsdf
votes
14323
3.htm
sdfdsgf
asfddsf
asdsa
What I do is:
restrict to lines matching ^votes (with context line 1 After the match)
--> subfilter
capture to variable "votes" ([X] Reset to initial value at start of each file) with the Initial Value .
then I remove all the content of the htm and add a header with the value of votes (@votes). Finally I append everthing in one *.csv
generally this works well, but not so well if textpipe doesnt find "votes", like in 3.htm in my example. then the result is NOT
9876
14323
.
..as I expected it to be but:
9876
14323
14323
..which gives me the impression the RESET doesnt work... what can I do to ensure a proper reset to the initial value?
greetings
S.