data from html to excel in linux [Closed]

Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello
I've a shell script which generates a html file in each iteration.I want to get 3 values from the html file to be merged in one xcel file sequentially.for example 100 iteration the data will be written in one xcel file in 100 rows and 3 columns from those 100 html files.Can anyone help me to sort this out??

7 replies

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
767
Most easy way would be instead of excel file, create a CSV file. CSV files are by default opened by excel
How to do that?
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
767
I guess you are using a bash scripts that is creating html file. You create CSV file in same way. It is just a text file that has extension csv. The columns are comma delimited and it would be better if you enclose each field with in ""
so like
"column 1", "column 2", "column 3"
Thanks a lot .Well I need some more help to sort it out.As I've stated previously I am generating the html files within a loop, each time I generate the csv file it'll override the previous one and i dont want to have the data in several csv file.Is there any procedure that the csv file will merge the data sequentially?
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
767
what script you are using to create the files ? Is it a regular bash or some thing else. You can echo the column to new file
some thing like

echo 'this is examlple' >> myfile.csv

>> is to append to the file as > is to overwrite
Yap it's working.I am just writing the output of a function to the csv file .The output of the function is like
"
Capturing coverage data from appdir
Found gcov version: 4.3.3
Scanning appdir for .gcda files ...
Found 1 data files in appdir
Processing tcas.gcda
Finished .info-file creation
Overall coverage rate:
lines......: 46.2% (30 of 65 lines)
functions..: 33.3% (3 of 9 functions)
branches...: 7.6% (5 of 66 branches)
"
Can I capture only the values 46.2%, 33.3% and 7.6% in the csv file?
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
767
I do not have access to a linux or unix box any more. How ever from what I can tell

can you direct these lines to a temp file ? Then you can use cat and grep do the the work

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!