你现在的流程是:
上传html——解析html——插入Excel——解析Excel——插入数据库你解析的Excel数据如果跟解析的html数据没啥子区别,我认为还是变一变
上传html——解析html——插入Excel——插入数据库内容已经解析过了,就不要在解析一次了吧!
上传html——解析html——插入Excel——解析Excel——插入数据库你解析的Excel数据如果跟解析的html数据没啥子区别,我认为还是变一变
上传html——解析html——插入Excel——插入数据库内容已经解析过了,就不要在解析一次了吧!
直接解析html插入数据库不就完了
我的想法是,上传后转换为Excel文件,然后用poi操作。这个思路不错 楼主可以试试
不知道有没有好的方法,把htm转换为excel,处理excel就方便多了。
我的想法是,上传后转换为Excel文件,然后用poi操作。这个思路不错 楼主可以试试
思路是这个思路,但是没有好的解决方法。求助
<tr height=20 style='mso-height-source:userset;height:15.0pt'>
<td height=20 class=xl96 style='height:15.0pt'>21200632801</td>
<td class=xl94> </td>
<td class=xl94>G109</td>
<td class=xl94>青藏线</td>
<td class=xl153 x:num>3671</td>
<td class=xl152 x:num>3672</td>
<td class=xl141 x:num>1000</td>
<td class=xl94>上行</td>
<td class=xl95>沥青</td>
<td class=xl99 width=42 style='width:32pt' x:num>82.5</td>
<td class=xl100 width=42 style='width:32pt' x:num>82.8</td>
<td class=xl100 width=42 style='width:32pt' x:num>95</td>
<td class=xl100 width=42 style='width:32pt' x:num>60</td>
<td class=xl100 width=42 style='width:32pt'> </td>
<td class=xl92></td>
</tr>
<tr height=20 style='mso-height-source:userset;height:15.0pt'>
<td height=20 class=xl96 style='height:15.0pt'>21200632801</td>
<td class=xl94> </td>
<td class=xl94>G109</td>
<td class=xl94>青藏线</td>
<td class=xl153 x:num>3672</td>
<td class=xl152 x:num>3673</td>
<td class=xl141 x:num>1000</td>
<td class=xl94>上行</td>
<td class=xl95>沥青</td>
<td class=xl99 width=42 style='width:32pt' x:num>85.9</td>
<td class=xl100 width=42 style='width:32pt' x:num>83.7</td>
<td class=xl100 width=42 style='width:32pt' x:num>70</td>
<td class=xl100 width=42 style='width:32pt' x:num>100</td>
<td class=xl100 width=42 style='width:32pt'> </td>
<td class=xl92></td>
</tr>
<tr height=20 style='mso-height-source:userset;height:15.0pt'>
<td height=20 class=xl96 style='height:15.0pt'>21200632801</td>
<td class=xl94> </td>
<td class=xl94>G109</td>
<td class=xl94>青藏线</td>
<td class=xl153 x:num>3671</td>
<td class=xl152 x:num>3672</td>
<td class=xl141 x:num>1000</td>
<td class=xl94>上行</td>
<td class=xl95>沥青</td>
<td class=xl99 width=42 style='width:32pt' x:num>82.5</td>
<td class=xl100 width=42 style='width:32pt' x:num>82.8</td>
<td class=xl100 width=42 style='width:32pt' x:num>95</td>
<td class=xl100 width=42 style='width:32pt' x:num>60</td>
<td class=xl100 width=42 style='width:32pt'> </td>
<td class=xl92></td>
</tr>
<tr height=20 style='mso-height-source:userset;height:15.0pt'>
<td height=20 class=xl96 style='height:15.0pt'>21200632801</td>
<td class=xl94> </td>
<td class=xl94>G109</td>
<td class=xl94>青藏线</td>
<td class=xl153 x:num>3672</td>
<td class=xl152 x:num>3673</td>
<td class=xl141 x:num>1000</td>
<td class=xl94>上行</td>
<td class=xl95>沥青</td>
<td class=xl99 width=42 style='width:32pt' x:num>85.9</td>
<td class=xl100 width=42 style='width:32pt' x:num>83.7</td>
<td class=xl100 width=42 style='width:32pt' x:num>70</td>
<td class=xl100 width=42 style='width:32pt' x:num>100</td>
<td class=xl100 width=42 style='width:32pt'> </td>
<td class=xl92></td>
</tr>
你试试用htmlparser看行不,这个专门解析Html的
碰到同样的问题,已经写好了Excel的解析,包括对其中数据的验证.
可后来发现用户可能上传Html格式的Excel,于是也在找转换工具,不是XML真是悲剧啊