LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Space from End of Text

I know this is an elementry problem, but I have been unable to find any threads to answer this problem.


I have a text file of numbers in double form spearated by a space each. At the end of the document I end up with an unnecessary space which then gets read by my next VI as an additional entry of zero, so I would like to simply remove the space before passing it to the next VI. I know how to set the file position to the end of the file, but there is no single character delete function that I know of. Any idea how I can do this?



Message Edited by jaysmall on 06-30-2008 10:22 AM
0 Kudos
Message 1 of 5
(2,942 Views)
Hi,

Is the data you want to modify being read as a string into LabVIEW?  If so, you can use the "Trim Whitespace.vi" in the string functions palette.  This will remove any leading or trailing whitespace from the string.

Kind regards,

Justin Fuller
National Instruments
Message 2 of 5
(2,930 Views)
If you want to shorten a given file by one byte (or character), you can just set the EOF to "file size minus one".
 
The advanced file palette has a VI "set file size", that should do it.
0 Kudos
Message 3 of 5
(2,926 Views)
There is a nice tool from OpenG to do this.  Could be useful in the future.
 
 
RayR
0 Kudos
Message 4 of 5
(2,899 Views)
Wonderful, thank you all for the suggestions
0 Kudos
Message 5 of 5
(2,879 Views)