I have an application that outputs a csv file. The csv file is not a normal 'database' style... it's laid out for viewing the data in Excel.
I'm building an application to reformat the data. A customer can upload his csv file, and I then pull it and write it to Excel (using
www.excelwriter.com).
Here's a sample file. The location of the data is always in the same position file to file - although the number of data records could increase or decrease (ignore START/FINISH).
****START****
Output from Pocket PC
2002/11/14 - 23:56:48
Pocket PC MAC address:00:0A:8A:47:D2:1D
Access Point List
,Channel,MAC Address,Signal(dBm),Noise(
dBm),S/N(d
b),Signal(
%),Noise(%
),S/N(%),W
EP,Bridge,
SSID,Beaco
n Interval,# STA,Preamble,PCF/DCF,RTS/C
TS,First seen,Last updated
,4,00:02:2D:3D:6F:E8,-93,-
96,3,1,1,0
,Yes,No,MH
ONetWork03
,100,11,Lo
ng,DCF,,23
:48:35,23:
56:47
,9,00:02:2D:40:65:05,-100,
-100,0,0,0
,0,Yes,No,
MHONetWork
01,100,19,
Long,DCF,,
23:48:48,2
3:56:16
,11,00:06:25:54:18:CC,-59,
-94,35,72,
1,71,No,No
,White,100
,1,Long,DC
F,,23:47:2
5,23:56:48
,7,00:04:5A:FA:84:5B,-100,
-100,0,0,0
,0,Yes,No,
KARRNET,10
0,2,Long,D
CF,Yes,23:
48:17,23:5
6:48
****FINISH******
Here's what I'm looking for:
1. I need the report name, date, etc. along with the datalist. What is the 'best' approach at reading this data? ie. import in db, read line by line, other
2. Could you supply me with an example of the code for this particular example above? If you could just generate a full list in asp, I could then map it to excelwriter. Example:
<body>
Ouput from Pocket PC
Date: 2002/11/14 - 23:56:48
Pocket PC MAC address:00:0A:8A:47:D2:1D
Report: Access Point List
<table>
<tr>
<td>Channel</td>
<td>MAC Address</td>
<td>Signal(dBm)</td>
<td>Noise(dBm)</td>
<td>S/N(db)</td>
<td>Signal(%)</td>
<td>Noise(%)</td>
<td>S/N(%)</td>
<td>WEP</td>
<td>Bridge</td>
<td>SSID</td>
<td>Beacon Interval</td>
<td># STA</td>
<td>Preamble</td>
<td>PCF/DCF</td>
<td>RTS/CTS</td>
<td>First seen</td>
<td>Last updated</td>
</tr>
<tr>
<td>4</td>
<td>00:02:2D:3D:6F:E8</td>
<td>-93</td>
<td>-96</td>
<td>3</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>Yes</td>
<td>No</td>
<td>MHONetWork03</td>
<td>100</td>
<td>11</td>
<td>Long</td>
<td>DCF</td>
<td></td>
<td class="xl22"="0.9920717592
5925928">2
3:48:35</t
d>
<td class="xl22"="0.9977662037
0370372">2
3:56:47</t
d>
</tr>
<tr>
<td>9</td>
<td>00:02:2D:40:65:05</td>
<td>-100</td>
<td>-100</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>Yes</td>
<td>No</td>
<td>MHONetWork01</td>
<td>100</td>
<td>19</td>
<td>Long</td>
<td>DCF</td>
<td></td>
<td>23:48:48</td>
<td>23:56:16</td>
</tr>
<tr>
<td>11</td>
<td>00:06:25:54:18:CC</td>
<td>-59</td>
<td>-94</td>
<td>35</td>
<td>72</td>
<td>1</td>
<td>71</td>
<td>No</td>
<td>No</td>
<td>White</td>
<td>100</td>
<td>1</td>
<td>Long</td>
<td>DCF</td>
<td></td>
<td>23:47:25</td>
<td>23:56:48</td>
</tr>
<tr>
<td>7</td>
<td>00:04:5A:FA:84:5B</td>
<td>-100</td>
<td>-100</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>Yes</td>
<td>No</td>
<td>KARRNET</td>
<td>100</td>
<td>2</td>
<td>Long</td>
<td>DCF</td>
<td>Yes</td>
<td>23:48:17</td>
<td>23:56:48</td>
</tr>
</table>
</body>