in reply to HTML-Parser: a newbie question: need to extract exactly line 999 out of 5000 files..
1) Copy your files to some working directory.
2) Run perl -i.old -ne 'print if $.==999' *html in that directory. That extracts line 999 from your files.
3) As the files contain now only a html-fragment we make it valid html again like this: perl -i.old -ne 'print "<html><body>$_</body></html>' *html
4) You have now a collection of html-files consisting only of the previous line 999 that you can parse further with whatever tool you want.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: HTML-Parser: a newbie question: need to extract exactly line 999 out of 5000 files..
by ag4ve (Monk) on Oct 16, 2010 at 01:56 UTC | |
by Perlbeginner1 (Scribe) on Oct 16, 2010 at 09:00 UTC | |
|
Re^2: HTML-Parser: a newbie question: need to extract exactly line 999 out of 5000 files..
by Perlbeginner1 (Scribe) on Oct 15, 2010 at 23:59 UTC | |
by morgon (Priest) on Oct 16, 2010 at 01:12 UTC | |
by Perlbeginner1 (Scribe) on Oct 16, 2010 at 09:15 UTC |