![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I extract text only from html file without HTML tag | los111 | UNIX for Dummies Questions & Answers | 4 | 11-28-2007 04:40 AM |
| need help with html button | mike171562 | Shell Programming and Scripting | 0 | 07-17-2007 05:09 PM |
| regarding html in c | phani_sree | High Level Programming | 10 | 07-07-2007 08:47 PM |
| Converting HTML to CSV | Jexel | UNIX for Dummies Questions & Answers | 3 | 03-18-2007 08:44 PM |
| perl and html | marcpascual | Shell Programming and Scripting | 8 | 09-21-2005 07:47 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
HTML to csv
Hi !! Could you please let me know of how can a html file be converted to csv.. I am looking out for a script which could do that.. Please find the below example
<HTML><BODY><TABLE> <TR><TD>Parent CR</TD><TD>ChildCR</TD><TD>Title</TD><TD>Description</TD></TR> </TABLE></BODY></HTML> <HTML><BODY><TABLE> <TR><TD>10048</TD><TD>14950</TD><TD>CR 10048 QA Issue</TD><TD>The AutoSett xml message generated got rejected in dBCRis. </TD></TR> <TR><TD>10048</TD><TD>15144</TD><TD>CR 10048 QA Issue</TD><TD>In the below message The csv should not have the html headers after transformation. Thanks in advance !! |
|
||||
|
Try this:
Code:
sed -n '/<TR/p' filename | sed 's/\(<TR><TD>\)\(.*\)\(<\/TD><TD>\)\(.*\)\(<\/TD><TD>\)\(.*\)\(<\/TD><TD>\)\(.*\)\(<\/TD><\/TR>\)/\2,\4,\6,\8/' Input: Quote:
Quote:
|
|
||||
|
Quote:
Hey, Are you taking "comma saperated value" in unix file iteself or you are taking it in some excel file ? If its excel file then let me know the logic for that. Thanks |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|