im trying to convert a file with an HTML table to CSV format. An excerpt from this file follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1"><link rel="shortcut icon" href="favicon.ico" /><title>
Untitled Page
</title></head>
<body>
<form name="form1" method="post" action="mypricelist.aspx" id="form1">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/somethingrandom" />
<div>
<table id="price_list" border="0">
<tr>
<td>ProdCode</td><td>Description</td><td>Your Price</td>
</tr><tr>
<td>ab101</td><td>loruem</td><td>1.1</td>
</tr><tr>
<td>ab102</td><td>ipsum</td><td>0.1</td>
</tr><tr>
i tried using
xls2csv -x -c\; evprice.xls > evprice.csv
but that gives me an error saying
evprice.xls is not OLE file or Error
I googled. it said that is was because the file wasn't proper xls but just html.
When i try
file evprice.xls
its says its html so found a 'solution', using libreoffice.
libreoffice --headless -convert-to csv ./evprice.xls
well this does not give an error but the csv output file is all weird, like opening an exe file in notepad.
it contains a lot of strange characters like these
—¬žþ9ü~ÆóXþK¢
anyone know why this is happening, and got a working solution?