03-20-2019 03:20 PM
Hello,
I am writing a VI that reads the number of lines in a document. I turn the spreadsheet into an array, use the insert into array function to input a piece of data into it at a specified location, and then rewrite to the same file with the new array with the appended information.
Every time I run the vi, a blank line is also being written that is messing up my counter. Is there an easy fix to this?
Thanks,
notAWizard
Solved! Go to Solution.
03-20-2019 03:56 PM
Is there an easy fix to this?
Probably, if we could see your code. Sounds like the array is picking up an extra line at the EOF, but without seeing the code, I can only guess at the solution.
03-20-2019 04:29 PM
If you are using 'Array to Spreadsheet String', it always appends an End of Line (\r\n) at the end, so you may want to remove those from the string (maybe Trim Whitespace) before writing to your file.
03-20-2019 07:40 PM
Since I cannot see the actual code, I can only guess for a 'possible' solution.
Use 'Trim Whitespace.vi' before writing your array with appended data back into the file.
Hope it helps.
03-21-2019 01:09 PM
notAWizard,
To become more "wizardly", attach your (failing) VI. We can examine it, test it, be sure we understand what you are doing, fix it, and explain why it isn't working. As you can see, there have been multiple "good guesses" as to the cause of your problem, but they might all be wrong, and this would be a waste of your time (reading and testing them) and our time.
Posting your code saves time (and effort) for all of us.
Bob Schor
03-22-2019 03:52 PM
Thanks to everyone who replied to my very vague question. Had to be vague due to company privacy policies, including not being able to post the vi.
You're awesome