Also, your efforts with filter.. Filter can be weird at first but once you get it its pretty straightforward.
With your supplied data, it appears that you were looking for any lines that contain the number 8011171604.
Put the data into a temp variable, then to use filter you need to understand how the wildcards work.
filter "8011171604" won't work because filter is looking at the whole line and so there is no match.
Since you want to match only the 2nd item you can use a wildcard to build up the string you're searching for.
filter "*,8011171604" The asterisk will match any number of characters up until it finds the next explicit match which is the comma. So, basically this means it will ALWAYs match up to the comma for every line. Then it matches the 8011171604 against the rest of the line.
If you were looking for partial matches in the 2nd part, you can add asterisks at strategic locations for wildcard matches.
So say you were looking for lines that start with 8011
filter "*,8011*" will do that.
Or if you're looking for all occurrences of 1117 anywhere in the 2nd item.
filter "*,*1117*" will do that.
Then theres the inclusion and exclusion parts of how filter works. If you "filter with "yourstringtofilterwith" it will Keep the matches. If you filter without, it will keep the non-matches.
So heres some sample code.
Code: Select all
put myList into tempVar -- since the data in the actual contain is changed put it into a temporary var
filter tempVar with "*,8011171604" -- filter the var
answer information tempVar -- based on sample data should now only contain the 17,... line.
Of course having said all this, for your purpose lineoffset is the way to go.
Mark wrote:Hi,
One more thing. Lineoffset also finds parts of lines. To make sure that you find a whole line, set the wholeMatches to true before calling the offset function. Note that the wholematches is set to false whenever your handler finishes.
Kind regards,
Mark