LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

search/replace string

I am trying to read a specific amount of lines from a file and replace the the text {delimiter} with a tab using the search/replace string.  The problem is that the output of the read lines is a 1-D array of string and the sink of the search/replace string is a string.  How do I correct this?  I tried concatenate strings but then couldn't get the string back apart into lines.  I also tried reading characters but soon realized that the characters in the file to be read is variable.  Any ideas?
0 Kudos
Message 1 of 6
(3,264 Views)
What version of LabVIEW are you using? LabVIEW 8.x has no Read Lines function and the Read Lines in earlier versions does not return an array. Do you really mean Read From Spreadsheet File? The Read Characters is an older function and if you simply wire a -1 to the number of characters input, you get the entire file. Posting your code would help in understanding what the issue is.
Message 2 of 6
(3,254 Views)

Here is my code.  I am using the read from text file vi with the read lines checkmarked.  Also attached is the file I am reading from

Message Edited by HereWeGo on 08-14-2008 02:00 PM
Message Edited by HereWeGo on 08-14-2008 02:01 PM
Message Edited by HereWeGo on 08-14-2008 02:03 PM
Message Edited by HereWeGo on 08-14-2008 02:03 PM
Download All
0 Kudos
Message 3 of 6
(3,246 Views)

You can change it by unselecting the read lines mode and wiring a -1 to the count input. That will read the entire file. You can leave it as it is and wire the string array into a for loop with the Search and Replace inside the for loop.

Message 4 of 6
(3,237 Views)
The problem is that it has to read exactly 34 lines and the 35th line has to be data.  The data output is going to be later scoped / analyzed in Excel.  Is this possible?
0 Kudos
Message 5 of 6
(3,232 Views)

Yes, as I already said. Did you read the entire answer?

 

"You can leave it as it is and wire the string array into a for loop with the Search and Replace inside the for loop."

Message 6 of 6
(3,229 Views)