LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CSV database

I  built a huge VI to monitor a person details. 

 

i wanted to modify this VI to be for several people. 

 

i don't have any access to any of SQL or SQL Server Express, neither MS Access to build a database. 

 

my only option is using CSV file as a database. 

 

writing to a CSV file is not a problem to me. 

 

reading the details is my problem. 

 

in the VI i have a user ID, age, weight, gender,  etc..... if i want to retrieve a data for one specific user, i should look into his ID. when i find this user, i should retrieve all the data that belongs to this ID. 

 

is there any link or a demo can let me learn this technique. i know i should user Search 1D array to look for the user ID, but up to the minute i don't know how to make it in the right way. 

 

any suggesting ? 

0 Kudos
Message 1 of 9
(4,340 Views)

Read the file with Read from spreadsheet file, Index array to get the ID column, Search 1D array to find which row and Index array to get the user row.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 9
(4,331 Views)

i tried this way, and i'm still not able to make it. 

 

 

0 Kudos
Message 3 of 9
(4,303 Views)

Hi N.,

 

attach your try (aka your current VI) and a sample CSV file to allow us to help you…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(4,300 Views)

Hi GerdW, 

 

this is a mock up of what i'm doing exactly in my VI. 

 

and i know i'm doing it wrong, but i never used Search 1D array before

 

 

 

Thanks 

0 Kudos
Message 5 of 9
(4,292 Views)

Hi N.,

 

what exactly does not work as intended?

 

In your VI you are

- reading a CSV file with each iteration, getting the first column and searching for something in this (column) array

- not using the search result

- appending the the very same CSV file a new line of user information

- doing all that in a loop again and again, without any timing (your file will get very big very fast)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 9
(4,278 Views)

the first and second point i didn't get them very well. 

i wanted to append the file 

and in my actual VI i'm using QMH, so i'm writing only once when i needed 

0 Kudos
Message 7 of 9
(4,271 Views)

Hi N.,

 

the first and second point i didn't get them very well.

You are reading the CSV file, index the first column and search for an element of this column.

What didn't you "get very well"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 9
(4,269 Views)

Well, you could try SQLite and theSQLite Library for LabVIEW by Dr. James Powell.

https://www.ni.com/en/support/downloads/tools-network/download.sqlite-library.html

 

Free, easy to work with, good examples and documentation and far superior to CSV.

0 Kudos
Message 9 of 9
(4,246 Views)