From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create database for csv file

Hello Labview Users, 

I happen to have thousands of csv data file that I work with. The only way I recognize them is putting their characteristics in the file name. Which brings the problem of making the names too long and Microsoft doesn't like to accept long name. So I wanted to build a database for all my files. I am in the preliminary stage of building it ( I have attached the file and some of you may have seen it before). 

What I want to do is, have all my files in the database with random names and list them based on their characteristics. I want to do that in my application in the place of 'file' box. So that I can click on the file and run it (double-click on the file in application to make them work in active file). based on the parameters listed on the database I want to filter them to find any specific file. How the interface of database should look like is shown blow. Screen Shot 2017-06-28 at 4.34.31 PM.png

It doesn't have to be a real database, just a directory application. I am trying to make it without the database toolkit.  If anyone can help me out and guide me out or guide me in the right direction then that would be great. Thanks. 

0 Kudos
Message 1 of 18
(4,042 Views)

Hi Huqs,

 

Attached to this reply are 3 VIs that are a (messy) part of a project I'm working on - unfortunately for you and anyone else who looks at these, it's a part I haven't yet invested more than the minimum time into.

 

Although these almost certainly won't run for you, due to a large number of missing classes, libraries and VIs, opening them should give you some idea as to how I handled a similar issue. They do use a real database, accessed using James Powell's free SQLite library.

 

If you don't want to use a real database, perhaps you can just shorten the filenames and use a directory search, followed by parsing to expand to a multicolumn listbox?

Something like "b56v1v1w560.csv" might be enough to parse to "Bandgap:56, Voltage1: 1, Voltage2: 1, Wavelength: 560"?

Example_VI.png


GCentral
Message 2 of 18
(3,994 Views)

And/or create an Index-file and with all characteristics and an ID-number, then name the files according to that file.

cbutchers idea is good, though.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
Message 3 of 18
(3,953 Views)

Hi Cbutcher, 

Thank you for showing me the files and suggestions. I will look more into it. However, I wasn't able to open anything you attached except the snippet. The files, when I tried to open them, it says, " File version is later than the current LabVIEW version". So I am not sure if it's something to do with my Labview 2015 version. 

0 Kudos
Message 4 of 18
(3,945 Views)

Yes - they were saved in 2016.

Below are snippets that hopefully show the idea, but I don't know how well they'll load. The 2016 versions were copied out of the project, but these are taken from the copied out versions so a bunch of links might be broken or missing.

ChooseDatasets_BD.png

PrepareTableSelectStatement_BD.png

FormatTableEntries_BD.png

 

Immediately as I look at this I wonder what I was doing with unbundling a status value rather than just wiring the error cluster to the next case structure. Doh!

 


GCentral
Message 5 of 18
(3,928 Views)

You can avoid the calculation part of the time by using a Seconds to time/date and grab the parts from the resulting cluster.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
Message 6 of 18
(3,918 Views)

@Yamaeda wrote:

You can avoid the calculation part of the time by using a Seconds to time/date and grab the parts from the resulting cluster.

/Y


Although I didn't previously know that Seconds to Date/Time returned a cluster (so that's interesting) I don't think that you're right about your conclusion, unless I'm misunderstanding where you mean?

 

Using StDT will give me hours, minutes and seconds from 9am, 1904 or something and my input is a duration in seconds. So if I have 72 as the input, hours in the cluster is 9.

 

Or did you mean something else?


GCentral
0 Kudos
Message 7 of 18
(3,912 Views)

Double to time rec.pngSomething like this should work, no?

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 18
(3,881 Views)

So now I'm pretty confident you're talking about the bottom part of the bottom snippet (with the Format to String node), but the problem is that the DBL value returned doesn't reflect a timestamp. As a result, the hours are wrong. You can see that in this example:

Example_VI.png


GCentral
0 Kudos
Message 9 of 18
(3,876 Views)

Ah, right! Set UTC input to true. 🙂

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
Message 10 of 18
(3,872 Views)