M
mosfet
Hi,
I would like to parse a very simple html(index_msg.htm) file described
below :
<tr>
<td>WM_ACTIVATE</td>
<td>0x0006</td>
<td></td>
<td>0x0000</td>
<td>WM_NULL</td>
</tr>
<tr>
<td>WM_ACTIVATEAPP</td>
<td>0x001C</td>
<td></td>
<td>0x0001</td>
<td>WM_CREATE</td>
</tr>
....
I would like to parse this file and to extract information like this :
enum foo
{
eWM_ACTIVATE = 0x0006,
eWM_ACTIVATEAPP = 0x0001,
...
};
I am starting with this :
fileIn = File.open("C:/WIKI_CE/index_msg.htm", "r")
fileOut = File.new("C:/WIKI_CE/enumWmMsg.h", "w")
begin
while (line = fileIn.readline)
line.chomp
$stdout.print line
end
rescue EOFError
fileIn.close
fileOut.close
end
but now I am stuck. Should I use regex or how can I compare two string ?
I would like to parse a very simple html(index_msg.htm) file described
below :
<tr>
<td>WM_ACTIVATE</td>
<td>0x0006</td>
<td></td>
<td>0x0000</td>
<td>WM_NULL</td>
</tr>
<tr>
<td>WM_ACTIVATEAPP</td>
<td>0x001C</td>
<td></td>
<td>0x0001</td>
<td>WM_CREATE</td>
</tr>
....
I would like to parse this file and to extract information like this :
enum foo
{
eWM_ACTIVATE = 0x0006,
eWM_ACTIVATEAPP = 0x0001,
...
};
I am starting with this :
fileIn = File.open("C:/WIKI_CE/index_msg.htm", "r")
fileOut = File.new("C:/WIKI_CE/enumWmMsg.h", "w")
begin
while (line = fileIn.readline)
line.chomp
$stdout.print line
end
rescue EOFError
fileIn.close
fileOut.close
end
but now I am stuck. Should I use regex or how can I compare two string ?