Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

427.Text file parser -- How to extract tables from html files into csv file automatically?

User: editor -- 2010-02-21
Hits: 119
Type: Text file parser   
Search all Text file parser examples
Description:
How to extract tables from html files into csv file automatically?
I have some html files downloaded from website, that has some tables inside it, all tables is begin with a <strong>xxxx</strong> tag, and followed by a <table xxx>xxxxxxxxxx</table>
Input Sample:
<html>
...
<strong>some title</strong>
<table xxx>
<tr xxx><td xxx>data11</td><td xxx>data12</td></tr>
<tr xxx><td xxx>data21</td><td xxx>data22</td></tr>
</table>
Output Sample:
some title
data11,data12,
data21,data22,
Answer:
Hint: You need to Download and install "Replace Pioneer" to finish following steps.
1. ctrl-o open source html file
2. ctrl-h open replace dialog
* in 'search for pattern', enter:

* in 'replace with pattern', enter:

* uncheck 'Print Unmatched Unit' option
* check 'Ignore cases' option
* click 'Advaned' tab:
put following into 'run following for each matched unit' entry:

3. click 'Replace', done.
4. ctrl-s save to file.

Note: if you want to process multiple html files, click 'Batch...' to open 'Batch Runner' window in step 3, then:
* drag html files from windows file browser to 'Batch Runner' window
* change 'set output file name' option, select the output filename rule, such as ###.csv(means 001.csv, 002.csv,...)
* click 'Batch Replace', done! 
Download Script:  scripts/427.rst.zip

Similar Examples:
How to extract titles of all html files and save them to one file? (61%)
How to make html tags for image file list automatically? (61%)
How to extract/parse title from many html files and join together? (59%)
How to convert many html files to text files all at once? (57%)
How to split every file in a directory automatically? (57%)
How to extract text from many webpage files and form a dabase file? (56%)
How to extract all image links from a html file? (55%)
How to import a list of urls to IE favorate automatically? (55%)

Check Demo of Text file parser