ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string convert

hi

just a stupid question maybe ...
but i'm missing some string convert functions.
e.g. i habe a list with something like:
text(space)text(space)text(spacespacespace)text
and want to convert one (or more) space(s) between the text into ONE tab.
i didn't found any function that makes me able to convert that so that i get
as a result:
text(tab)text(tab)text(tab)text

maybe someone has an idea?

thanks,
0 Kudos
Message 1 of 3
(3,097 Views)
Use the VI located in the LabVIEW directory
examples\general\strings.llb\Search String and Replace- General.vi
Set the old pattern to replace [\s]+
Set the new pattern to tab.

[\s]+ is a regular expression that means to the "Match Pattern" function:
any non-empty sequence of spaces.

Jean-Pierre Drolet


Tobias Theune a écrit dans le message :
396c6aad@newsgroups.ni.com...
> hi
>
> just a stupid question maybe ...
> but i'm missing some string convert functions.
> e.g. i habe a list with something like:
> text(space)text(space)text(spacespacespace)text
> and want to convert one (or more) space(s) between the text into ONE tab.
> i didn't found any function that makes me able to convert that so that i
get
> as a result:
> text(tab)text(tab)t
ext(tab)text
>
> maybe someone has an idea?
>
> thanks,
>
>
0 Kudos
Message 2 of 3
(3,097 Views)
Hi Tobias,

use the functions "Scan from string" and "Format Into String"
with the format strings "%s\s%s\s..." and "%s\t%s\t..." like
in the VI attached to this mail.

maybe that helps you

best regards

Guenter

Tobias Theune wrote:

> hi
>
> just a stupid question maybe ...
> but i'm missing some string convert functions.
> e.g. i habe a list with something like:
> text(space)text(space)text(spacespacespace)text
> and want to convert one (or more) space(s) between the text into ONE tab.
> i didn't found any function that makes me able to convert that so that i get
> as a result:
> text(tab)text(tab)text(tab)text
>
> maybe someone has an idea?
>
> thanks,
0 Kudos
Message 3 of 3
(3,097 Views)