LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

parsing text file

Hi all...

I am trying to find some example code that will read a comma delimited file, 3 columns wide, and feed the data into an existing 3 column SQL data table.  I am able to open and read the file but I am struggling with the parsing portion of the code.  Any hints, example code, or suggestions would be MUCH appreciated.  Smiley Happy

I have attached the CSV file if it helps.

Thanks,

Greg

0 Kudos
Message 1 of 7
(3,265 Views)
Hi gdutson:

I've made this small VI. I hope I understood well what you need to do. If not, let me know Smiley Very Happy Hope it helps!

Regards.

Robst



Robst - CLD

Using LabVIEW since version 7.0


Download All
0 Kudos
Message 2 of 7
(3,263 Views)
Thanks Robst, That got the data into an array.  I see that in order to get it into the SQL table I have to convert it to a cluster.  I have tried to do that but I am now getting an error on its way into the table.  I have attached a couple of screen shots with the error message.  Thanks to all for any help. Greg

Message Edited by gdutson on 02-01-2006 11:01 PM

0 Kudos
Message 3 of 7
(3,260 Views)
Hi gdutson:

Ok, so let's work now trying to put the data into the cluster you need. I'm afraid that I can't see the screenshots you uploaded, Are u sure u uploaded them? It also would be helpful if you could show me which VI are u using for inserting the data into the table, in order to know the exact format of the cluster you need.

Regards.

Robst.


Robst - CLD

Using LabVIEW since version 7.0


0 Kudos
Message 4 of 7
(3,247 Views)
Robst,

Sorry...I edited the post to include the pic.  Smiley Happy

Sheeesh...I thought I only did that with email.

Greg
0 Kudos
Message 5 of 7
(3,246 Views)
Hi gdutson:

Ok, I've seen the screenshot and I think I have found some issues on the VI. You're creating the cluster correctly, but only for one row of the array. If you want all the data to be inserted in the table you must create a cluster for each row in the 2D array. It may be a good idea to do it in a for loop.

 And about the error, well I currently don't have the Database Connectivity Toolset but searching in the web I found out that you need to wire in the columns input of the VI an 1D array with the column names that match with the elements that the cluster contains. As I see in the screenshot, you're wiring an empty array to the columns input, and that's why you're getting the error message. Modify the array constant so it contains the correct column names and the error should dissapear.



Robst - CLD

Using LabVIEW since version 7.0


0 Kudos
Message 6 of 7
(3,241 Views)
Robst,

OK I will try and revise per your suggestions and post the results tomorrow.  Thanks for your help. Smiley Happy

Greg
0 Kudos
Message 7 of 7
(3,232 Views)