08-14-2009 12:17 PM
smercurio_fc wrote:Since you have fixed-width files then you can't use the standard Read From Spreadsheet File VI since your delimiter will change depending on the number in the column. Your best bet is to read the file in as lines and then parse each line. In LabVIEW 8.x this is quite easy to do. In LabVIEW 7.1 you need two steps. See attached as a starting point.
I did not understand what you were saying about viewing the data as 1D and 2D collection mode.
That's the only way I know, too.
08-14-2009 12:29 PM
billko wrote:
smercurio_fc wrote:Since you have fixed-width files then you can't use the standard Read From Spreadsheet File VI since your delimiter will change depending on the number in the column. Your best bet is to read the file in as lines and then parse each line. In LabVIEW 8.x this is quite easy to do. In LabVIEW 7.1 you need two steps. See attached as a starting point.
I did not understand what you were saying about viewing the data as 1D and 2D collection mode.
That's the only way I know, too.
That's maybe because you don't know the Open G tools
They allow "ignore multiple delimiters" and that's the whole trick!!
See my solution on bottom page 1
08-14-2009 12:47 PM
Alain S wrote:
That's maybe because you don't know the Open G tools
They allow "ignore multiple delimiters" and that's the whole trick!!
See my solution on bottom page 1
That VI is not required, and doesn't really buy you anything. Also, the use of the Decimate 1D Array function means that you're hard-coding the number of columns.
Also, please note that the OP has LabVIEW 7, so they do not have the Read from Text File function.
08-14-2009 01:23 PM
smercurio_fc wrote:Also, the use of the Decimate 1D Array function means that you're hard-coding the number of columns.
Programming this : is also hard-coding the number of columns
smercurio_fc wrote:
Also, please note that the OP has LabVIEW 7, so they do not have the Read from Text File function.
Where did you get that idea? Can't read any reference to any LV version in this whole thread?
08-14-2009 01:44 PM
Alain S wrote:Programming this : is also hard-coding the number of columns
That was for demonstration, and my comment in the block diagram explicitly says that this would be only useful if you know the fixed width and columns ahead of time. It was not meant to be used, but to be seen as a comparison to the second method I had shown, which is a more general approach.
Alain S wrote:
smercurio_fc wrote:
Also, please note that the OP has LabVIEW 7, so they do not have the Read from Text File function.
Where did you get that idea? Can't read any reference to any LV version in this whole thread?
Just download the VIs the poster uploaded. You will see that they are in LV 7.1
08-14-2009 01:48 PM - edited 08-14-2009 01:49 PM
Alain S wrote:smercurio_fc wrote:
Also, please note that the OP has LabVIEW 7, so they do not have the Read from Text File function.
Where did you get that idea? Can't read any reference to any LV version in this whole thread?
From their VI.
When you open a VI and it has the changed asterisk in the title bar, you know something has changed just by opening it. Usually because it was recompiled from an older version to the version you opened it in. Do a VI properties and List Unsaved Changes and it will give you the details. In this case it was saved in an older version of 7.1. If you don't get changed asterisk, then they saved it in the same version you opened it in. If you get an error about not being able to open it, it was saved in a newer version than you opened it in.
08-14-2009 03:05 PM
Alain S wrote:
billko wrote:
smercurio_fc wrote:Since you have fixed-width files then you can't use the standard Read From Spreadsheet File VI since your delimiter will change depending on the number in the column. Your best bet is to read the file in as lines and then parse each line. In LabVIEW 8.x this is quite easy to do. In LabVIEW 7.1 you need two steps. See attached as a starting point.
I did not understand what you were saying about viewing the data as 1D and 2D collection mode.
That's the only way I know, too.
That's maybe because you don't know the Open G tools
They allow "ignore multiple delimiters" and that's the whole trick!!
See my solution on bottom page 1
Usually when I propose a solution, I try to make it as generic as possible so even if the user has only the basic install it will work. But you are absolutely correct that I haven't been exposed to Open G tools, so I did not know this was an option. Even so, I would've recommended the generic solution first, then the other solution as an advanced one. 😉
Bill
08-17-2009 03:11 AM
Thanks for the advice.
I modified your program but an error message 85 occurs. See attached. Any hints?
08-17-2009 03:32 AM
Even with the original vi one get an error
That's why I looked for an error free solution , that you can't use because of you're "older" LV version
Anyway, just wire the "error out" connecter of the "scan from string" vi to the loop and connect an array of error clusters to the Auto-Indexed tunnel.
Now you won't have that pop up window anymore but still can see the errors in the error cluster array.
Since the file is processed correctly I wouldn't care too much
08-17-2009 03:44 AM