LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

bug in spreadsheet to array?

Solved!
Go to solution

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 Kudos
Message 1 of 7
(2,224 Views)

Please post your html file, so we can try.

 

George Zou
0 Kudos
Message 2 of 7
(2,219 Views)

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 Kudos
Message 3 of 7
(2,207 Views)
Solution
Accepted by topic author 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 Kudos
Message 4 of 7
(2,191 Views)

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 Kudos
Message 5 of 7
(2,175 Views)

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 Kudos
Message 6 of 7
(2,163 Views)

@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.Smiley Wink

 

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 Kudos
Message 7 of 7
(2,137 Views)