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          << 426  428 >>
Hits: 3733
Type: Text file parser   
Search all Text file parser examples
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:
<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>
Output Sample:
some title
Hint: You need to Download and install "Replace Pioneer" on windows platform 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/

Screenshot 1:  Replace_Window

Screenshot 2:  Replace_Advanced_Window

Similar Examples:
How to extract tables from many html files into one csv file? (79%)
How to extract titles from many html files into a txt file? (72%)
How to add title attribute for all images in html files automatically? (63%)
How to add alt attribute for all img tags in html files automatically? (62%)
How to extract half of lines from a text file randomly? (62%)
How to extract multiple fields from data file and create a csv file? (61%)
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%)

Check Demo of Text file parser
extract tables from html  extract tables from html files  extract tables  extract table  xxxxx  strong  website  table  inside  site  extract table from html file  extract csv from html table  extract table html csv  extract table from html  extract html tables to csv  extract html table from multiple files  extract table automatically from html  extract table from html to file