Comment...
| Capture the value of osisWork
|
+--Restrict to between tags <work>...</work>
| [ ] Include text
| [X] Match case
| Max size: 65536
|
+--Restrict to each line in turn
|
+--Perl pattern [osisWork="(.+)"] with []
| [X] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
| Maximum text buffer size 4096
| [X] Maximum match (greedy)
| [ ] Allow comments
| [ ] '.' matches newline
| [X] UTF-8 Support
|
+--Perl pattern ["(.+)"] with []
| [X] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
| Maximum text buffer size 4096
| [ ] Maximum match (greedy)
| [ ] Allow comments
| [ ] '.' matches newline
| [X] UTF-8 Support
|
+--Capture to variable @osisWork
Reset: 1
Could I then have a subsequent subfilter that only takes certain actions depending on the value of the osisWork variable?
i.e. For a filter to be appled to several very similar works, but with some special cases applicable only to certain works. Assume that all these works have the same set of input filenames.
dim lineNumber
function processLine(line, EOL)
lineNumber = lineNumber + 1
if (lineNumber = 100) then
'start the special processing on line 100
TextPipe.initSubFilters
TextPipe.subFilterChunk( line & EOL )
processLine = ""
else if (lineNumber > 100) and (lineNumber < 200) then
'special processing for lines 100..200
TextPipe.subFilterChunk( line & EOL )
processLine = ""
else if (lineNumber = 200) then
'end special processing on line 200
TextPipe.flushSubfilters
processLine = line & EOL
else
processLine = line & EOL
end if
end function
function endFile()
if (lineNumber = 100) then
endFile = ""
else if (lineNumber > 100) and (lineNumber < 200) then
TextPipe.flushSubfilters
endFile = ""
else if (lineNumber = 200) then
TextPipe.flushSubfilters
endFile = ""
else
endFile = ""
end if
end function
function startJob()
lineNumber = 0
end function