LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem openning file with 9 spaces separation between columns... help!

Hi,

I am trying to open one file with 2 columns, the problems is the columns is separate with 9 spaces of caracter and i dont know what put in the delimiter option...

Any help?.

Regards, Fonsi.
0 Kudos
Message 1 of 12
(3,474 Views)
0 Kudos
Message 2 of 12
(3,470 Views)
0 Kudos
Message 3 of 12
(3,465 Views)
You are on the right track and your code is close.

The first thing to do is right click on the string control and change it to '\' Codes Display

Notice your delimiter is \s\\s, which I doubt is in your file. You are correct that \s is a space, however that is only valid in the \ code display. So your delimiter is a space followed by a true "\" character followed by an "s"

So you have 2 options to create a 9 space delimiter. In slash codes display type in \s\s\s\s\s\s\s\s\s or in the normal view just hit the space bar 9 times.
Message 4 of 12
(3,464 Views)
yes, thanks.
But the problem is sometimes the spaces are 9 another time are 10.
Any way to get it?.
Regards,Fonsi
0 Kudos
Message 5 of 12
(3,440 Views)
If you are not sure how many spaces there will be between values I would try something different. Here is a VI that takes a string and converts it over for you. I simple replace all groups of spaces with a tab control and then use the Spreed Sheet string to Array VI.

So read your file in as a string and feed it through this example code.
Message 6 of 12
(3,434 Views)
Thank you, very much.
I got it.

Regards, fonsi
0 Kudos
Message 7 of 12
(3,422 Views)
Personally, I prefer the "scan strings for tokens", because it skips empty tokens and thus any consecutive sequence of separators are treated as a single separator (what if somebody manually edits the file and replaces a few spaces with tabs?).

Have a look at my old example from this thread . (Also have a look at the slighly more complex version in my last post of the quoted thread).
Message 8 of 12
(3,408 Views)
altenbach, thanks!.

Runs well too.

In my case, always is the same spaces, since is got from the output of soft, and i get this file to draw in my application...

Regards
0 Kudos
Message 9 of 12
(3,406 Views)

@Fonsi wrote:
In my case, always is the same spaces, since is got from the output of soft, and i get this file to draw in my application...


Are you sure about that? In the image you posted above, the number of spaces seems to changes at 10000 and above.
Message 10 of 12
(3,401 Views)