Conversion of xhtml data into csv format using dump utility


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Conversion of xhtml data into csv format using dump utility
# 1  
Old 05-29-2012
Conversion of xhtml data into csv format using dump utility

Hi Unix Gurus,

I tried to convert the attached xhtml table content into csv file using unix shell script (lynx -dump filename) and got the below results:
Code:
 
Title ID Owner Priority Estimate Project Change Date Changed By
Complexity Create Date Created By Detail Estimate Total De tail
Estimate Done Feature Group Reference Source Split From Split From ID
Sprint Sprint State Status Story Status Team To Do Old ID Story Team
RR - Bug in m_tgt_fact_org_hierarchy mapping D-04980 Geraldraj S
elvaraj 3 - Could Have 5.00 2012 BI Project 05/23/2012 08:32 Sujith
Mukundan 10/21/2010 14:11 Karthik Iyengar 0.00 0.00 1.3 Ratings
Reporting Custom er Sprint 10 (10 -23 May) Closed Accepte d
RR New User - Password Reset B-38882 Geraldraj Selvaraj 1 - Must Have
3.00 2012 BI Project 02/01/2012 12:49 Administrator 08/12/2011 11:48
Rakesh Sinha 26.00 26.00 6.00 1.3 Ratings Reporting EU Compliance
Request - Counts Generation -ETL Analysis B-38881 Sprint 2 (19 Jan- 1
Feb) C losed Accepted

But I want the output as follows:

Row1:
Code:
Title,,ID,Owner,Priority,Estimate,Project,Change Date,Changed By,Complexity,Create Date,Created By,Detail Estimate,Total Detail Estimate,Done,Feature Group,Reference,Source,Split From,Split From ID,Sprint,Sprint State,Status,Story Status,Team,To Do,Old ID,Story Team

Row 2:
Code:
RR - Bug in m_tgt_fact_org_hierarchy mapping,,D-04980,Geraldraj Selvaraj,3 - Could Have,5.00,2012 BI Project,23/05/2012,Sujith Mukundan,,21/10/2010,Karthik Iyengar,0.00,0.00,,1.3 Ratings Reporting,,Customer,,,Sprint 10 (10 -23 May),Closed,Accepted,,,,,

Row 3:
Code:
RR New User - Password Reset,,B-38882,Geraldraj Selvaraj,1 - Must Have,3.00,2012 BI Project,01/02/2012,Administrator,,12/08/2011,Rakesh Sinha,26.00,26.00,6.00,1.3 Ratings Reporting,,,EU Compliance Request - Counts Generation -ETL Analysis,B-38881,Sprint 2 (19 Jan- 1 Feb),Closed,Accepted,,,,,

Could you please advice me if there is any option in dump utility to convert the html table content into above expected format? Or else please advise me any other method (unix script) to resolve this.

I would highly appreciate your help on this.

Last edited by joeyg; 05-29-2012 at 01:33 PM.. Reason: Please wrap data and command/scripts in CodeTags
# 2  
Old 05-29-2012
Well, can you
Code:
cat

the file?
You should also be able to use awk, sed, grep, and other tools.
# 3  
Old 05-29-2012
Hi joeygm

Please refer to the attached file (v4.html) in the original mail.
# 4  
Old 05-29-2012
html is a type of file. But, you should be able to cat or other unix commands on it. So, that is to answer your issue regarding 'other than dump?'

So, what are you trying to extract?
header line?
RR line?
RR - New line?

Always just three items?
# 5  
Old 05-29-2012
joeyg,

Could you please download the v4.html file into your pc and please open it in notepad & that will show you the "cat" of the content.

I am trying to extract the attribute values for all the lines and the number of lines will be more than 50k.
# 6  
Old 05-29-2012
I understand all that, but am trying to get you to explain what you are trying to extract. By attribute, do you mean any line with:
Code:
<td class=

# 7  
Old 05-29-2012
Quote:
Originally Posted by bi.infa
Hi Unix Gurus,

I tried to convert the attached xhtml table content into csv file using unix shell script (lynx -dump filename) and got the below results:
why not -dump it with 1300 or more columns (check how many you need) like this

Code:
lynx -dump -width=1300 filename.xhmtl >filename.txt

It looks like the dump has fixed width that can easily be imported as a csv-file. Else respond and something can be done to replace the blanks with commas in awk.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Log file data into CSV format

I m looking for help here!!! Can we filter the below log data into CSV format ? 1 2 3 4 5 6 7 8 timestamp INFO <text > - Some text (1 Reply)
Discussion started by: MohSalNiz
1 Replies

2. UNIX for Beginners Questions & Answers

How to Dump data into CSV file which is Separate by <tab>?

Dear Team, please help me to solve this problem using Linux command. I want to dump this data into an excel sheet, Suppose I have a string like: ABC PQR XYZ ASD then I expect output as a ABC XYZ PQR ASD (3 Replies)
Discussion started by: Shubham1182
3 Replies

3. Shell Programming and Scripting

LDAP data in CSV format

Hi all, I am new here, please don't eat me alive.. I am trying to find a good community to learn and participate in unix / linux discussions to help me improve in my current job. That being said, I have a problem which I didn't expect to challenge me, but I can't seem to find a viable... (8 Replies)
Discussion started by: tfm217
8 Replies

4. Shell Programming and Scripting

Shell script for .Txt to .csv conversion with data processing

Hi experts, I want to convert a txt file having rows and columns (CNAI_DUMP_raw.txt) by comparing it with another text file (paramaters.txt) and generate a output in CSV which contains only 3rd column from CNAI_DUMP_raw.txt, and the columns mentioned in parameters.txt. FYI: There are two... (16 Replies)
Discussion started by: Gautam Banerjee
16 Replies

5. Shell Programming and Scripting

CSV data format manipulation

Hi There I need a script which will pick up the data from a .CSV file and reformat it as per the requirement and write it to another .CSV file. I am using an application that will only take data in a particular format and need something that will convert without manual intervention. The... (4 Replies)
Discussion started by: rbggbr16
4 Replies

6. Shell Programming and Scripting

conversion of spaces into CSV format file

INput file attached in thread : Column widths at 24,73,82,87,121 characters (sed 's/./,/24;s/./,/73;s/./,/81;s/./,/87;s/./,/121;s/ *, */,/g' fixedinputfile >output.csv ). The client wants instead of hard coding the column widths as they are not fixed .he has given the hint stating that ( ... (3 Replies)
Discussion started by: sreenath1037
3 Replies

7. Shell Programming and Scripting

Conversion of spaces Text file into CSV format file

Input file (each line is separaed by spaces )given below: Name Domain Contact Phone Email Location ----------------------- ------------------------------------------------ ------- -----... (18 Replies)
Discussion started by: sreenath1037
18 Replies

8. Shell Programming and Scripting

Conversion of below Tabs Tex file into CSV format file : shell script needed

Request if some one could provide me shell script that converts the below "input file" to "CSV format file" given Name Domain Contact Phone Email Location ----------------------- ------------------------------------------------ ------- ----- ---------------------------------... (7 Replies)
Discussion started by: sreenath1037
7 Replies

9. Solaris

COnversion utility xhtml file to Postscript file

Hi, Can any suggest me some utility to convert xhtml file to postscript file format? Also tell me from where to down load such utility.. With Regards, Dattatray (0 Replies)
Discussion started by: dattatray.b
0 Replies
Login or Register to Ask a Question