Instead of first searching and then looking for the tag you could read the file so that you already have separated each text and its tag
For example you can change $/ to "<text>" so that when you read that file, you read it not line by line, but text by text.
Or just parse line by line and store into a new index of an array whenever a line begins with '<text>'. Have an array for the tags and an array for the texts where corresponding tag and text have the same index and you have all the information "finely sliced at your fingertips" ;-)
In reply to Re: Retrieving meta information from txt
by jethro
in thread Retrieving meta information from txt
by fanticla
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |