LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to trim white space and move string position

Does anybody can help me out, I tried to trim white space and move
string to begining of each line, example:
Text file: " AAA "
" BBB CCC "

How do I output them as: "AAA "
"BBB "
"CCC "

I had tried Trim Whitespace.VI + other Scan string function but not
getting nowhere.
Thanks for help.
0 Kudos
Message 1 of 6
(5,549 Views)
0 Kudos
Message 2 of 6
(5,541 Views)

Trim white space node works for me.

I also tried Dragon64's example, it works too.

If all you want to do is get rid of the spaces in front of one string

Hope this helps




Message Edited by Van_L on 02-19-2008 10:44 AM
Van L
NI Applications Engineer
0 Kudos
Message 3 of 6
(5,516 Views)

You can do a Search and Replace, find the space constant and replace with a space constant concatenated with a carriage return constant

 

edit - you'd need to ignore the cases where you already had a space-CR, though



Message Edited by JeffOverton on 02-19-2008 11:52 AM
0 Kudos
Message 4 of 6
(5,506 Views)
On Feb 19, 9:10 am, JeffOverton <x...@no.email> wrote:
> You can do a Search and Replace, find the space constant and replace with a space constant concatenated with a carriage return constant
> <img src="http://img137.imageshack.us/img137/1591/replaceef1.png">
> &nbsp;
> edit - you'd need to ignore the cases where you already had a space-CR, thoughMessage Edited by JeffOverton on 02-19-2008  11:52 AM

Thanks for helping. I click on <img src="http://img137.imageshack.us/
img137/1591/replaceef1.png"> but nothing there.
Regards,
0 Kudos
Message 5 of 6
(5,480 Views)
It's just a picture of the wire diagram.  Those VIs are both in the String palette, and they are called Concatenate Strings.vi and Search and Replace.vi
0 Kudos
Message 6 of 6
(5,467 Views)