12-02-2009 09:22 PM
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 🙂
Solved! Go to Solution.
12-02-2009 10:09 PM - edited 12-02-2009 10:10 PM
12-02-2009 10:32 PM
12-03-2009 04:24 AM
thanks!
I never realize there's an option to read line by line using read file function
Know I know 😄