LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stray Character appears when I extract tables from MS Word

Solved!
Go to solution

Hello, 

One of my projects involved reading tables from MS Word onto LabView. My code works and I got to display specific tables, however, each data appeared with a box symbol beside it. The image is included below. Because of this, I the program cannot cross reference the table with the required parameter to determine the index of the parameter.

 

Another issue was that the Test Number column in the Word document contained auto generated numbers. This was not displayed on the array in LabView. I couldn't find out ways to troubleshoot that. 

 

PS: I did try reading reading other Word documents that included tables, but the same issue persisted. I included the VI as well. 

Download All
0 Kudos
Message 1 of 5
(2,103 Views)

If I run this code in 2012, I also see stray characters.  If I turn on '\' Codes Display, I see '\r\07' appended to each cell.  I don't know where this comes from.  But one work-around would be to delete the last 2 characters from every cell.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 5
(2,078 Views)

Hi aputman, 

Thank you for your response. When you say deleting the last 2 characters from every cell, do you mean from the tables in the Word document, or the displayed table on Labview?

 

Also, this is only a small segment of a much larger program and the data that I have as control in my VI, will actually be derived from running tests. Data will not be manually inputted to this VI.

 

0 Kudos
Message 3 of 5
(2,065 Views)
Solution
Accepted by topic author taasin19

I'm talking about the data displayed in LabVIEW.  After the Range.Text node and before autoindexing the value, strip off the last characters.  Like I said, turn on the Codes Display so you can see what additional characters are added...and remove them. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 5
(2,061 Views)

The pair of characters \0C\07 or \r\07 is the 'end of cell' marker used by MS Word, so that is where they come from.  The solution is to either remove it yourself as suggested, or configure the TextRetrievalMode interface to not include hidden text or field codes.  This mode selects what text is returned in the Range object.

0 Kudos
Message 5 of 5
(2,030 Views)