キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

bug in spreadsheet to array?

解決済み
解決策を見る

Hi!

 

So, reading a html file and extracting a table, i used String to spreadsheet with "<tr" and an inner loop with "<td" as delimiters. Sound logical right?

 

Somehow i got an empty row and an empty column and it's reproducible with a string control starting with "<tr". Is this a known bug and/or fixed in 2011 SP1 ?

 

/Yamaeda 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 件の賞賛
メッセージ1/7
2,899件の閲覧回数

Please post your html file, so we can try.

 

George Zou
0 件の賞賛
メッセージ2/7
2,894件の閲覧回数

I've extracted the innards of the html table in another step wants to convert this text (attached as file) to a 2D table.

 

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 件の賞賛
メッセージ3/7
2,882件の閲覧回数
解決策
トピック作成者Yamaedaが受理

I think what you're saying is that if the string begins with the delimiter, you get a blank element (if you set the delimiter to ',' and feed it ",5,8" you get ["","5","8"]).  I wouldn't call this a bug, because there might be cases where you want to have an empty element (such as an empty string) in a list, and that empty element could be the first element of the array.

0 件の賞賛
メッセージ4/7
2,866件の閲覧回数

It would seem to me that it would be far more logical (in response to the first question in the original post) to use the XML Parser functions to do this since that portion of HTML can be treated as XML. Just providing an alternate solution.

0 件の賞賛
メッセージ5/7
2,850件の閲覧回数

I figured that Smercurio, but i haven't look at that alot so didn't get it to work in a hurry. Any pointers on that one?

 

@Nathan, you're right, the delimiter is supposed to be _after_ the cell, so i should get an empty first ... maybe i should use </tr> and </td> instead ...

 

So, there's no bug here, circle around, nothing to see. 😉 

 

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 件の賞賛
メッセージ6/7
2,838件の閲覧回数

@Yamaeda wrote:

I figured that Smercurio, but i haven't look at that alot so didn't get it to work in a hurry. Any pointers on that one?


Sure, since you're dealing with Starcraft info, and I thought the original Starcraft was an awesome game.スマイリー ウインク

 

If you open the Example Finder and search for "XML", open the example called "Query XML Document for Multiple Nodes". Take the text that you posted and replace everything between <bookstore> and </bookstore> in the large string control in the front. Thus, the large string control should have

<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>

<tr> .... </tr>

</bookstore>

Change the search string to "/bookstore/tr/td". When you run the VI the array should give you all of the <td> elements.

 

That should be a good start.

0 件の賞賛
メッセージ7/7
2,812件の閲覧回数