LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help reading DAT files

I need to read a .dat file that contains data in the form of a spreadsheet. What function should I use to access the data? I assume it should read the file and convert the data into a cluster of arrays representing the columns of the file. I've tried using the format of the examples, but the one I tried gave me a 1-D array with nonsensical values. Please help!
0 Kudos
Message 1 of 5
(3,470 Views)
There are many possible formats. Are the values separated by e.g commas or TABs? Is there a header?

Paste a few lines of your *.dat file here (if it is humanly readable) or attach it and we will be able to help better.

In the meantime, have a look at "Read from spreadsheet file.vi" in the File I/O Palette. It might just do what you need. A 2D array output will do just fine. Converting the data into a cluster of arrays will make it less convenient to handle in the code.
0 Kudos
Message 2 of 5
(3,466 Views)
Thanks, i'm attaching my file. some previously written software that I'm using spits out data in this form.

Note: I couldn't attach it as a DAT file because apparently that is not one of the valid extensions for this discussion board (that's ingenious), so instead i saved it as a text file.

-Yusif
0 Kudos
Message 3 of 5
(3,435 Views)
You should have done what altenbach suggested and used Read From Spreadsheet file. It returns a 2D array with the values. The only thing it doesn't do is read the column headers because they're strings. You can use Read Lines From File to get the first line, wire mark after read output to start of read offset of Read From Spreadsheet.
0 Kudos
Message 4 of 5
(3,429 Views)
That's it Yusif, If you need any help just ask.
-----------------------------
Ayman Mohammad Metwally
Automation Engineer
Egypt - Cairo
0 Kudos
Message 5 of 5
(3,412 Views)