LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Concatenate strings

Solved!
Go to solution

What I'm trying to do is, read a few rows from a file, concatenate a constant to each row and save the final result 

 

From file a.txt:

n4 

n3

n2 etc 

 

Final result: 

$n4 

$n3 

$n2 etc 

 

What I did, I get the number of rows 

The loop would loop by the number of rows. 

I then concatenate '$n' with the number, which I change, number to string

 

Is there any other way to get the same result without ignoring the data in the file? I do realize that I'm not at all using the data from the file apart from to know how many row is it, and recreate new data (by adding '$n' instead of just '$'), and by chance that the input (a.txt) is in the right order, ie from 0-any number. But if I'm using numbers that don't relate to each other (10, 6, 1, 7...) I can't concatenate it the way I did here as it won't give the right output 

 

Thanks 🙂 

 

 

 

Download All
0 Kudos
Message 1 of 4
(3,573 Views)
Solution
Accepted by topic author a01lida

Hi a01lida,

  Ofcourse you cant ignore the data as you are reading the file.You can use read text file function and select option as "read lines" and use.Pleas go through the attachments.

 

Thanks and regards,

srikrishnaNF

Message Edited by srikrishnaNF on 12-02-2009 10:10 PM
Regards,
Srikrishna


Message 2 of 4
(3,555 Views)
Instead of starting a new thread, continue this question in the original thread.
0 Kudos
Message 3 of 4
(3,543 Views)

thanks!  

I never realize there's an option to read line by line using read file function

Know I know 😄 

 

 

 

 

 

 

 

 

 

 

 

 

0 Kudos
Message 4 of 4
(3,514 Views)