11-04-2012 05:24 PM
I am using the "Read from text file" block to read the data from my .txt file into labview. It is now in string format. I have many numbers in the file.
For example:
0.45
0.35
0.12
1.354
1.56
2.89
5.89
0.56
That is what a text file might look like. I want to find which of these numbers is largest, and do calculations with that number. I am having trouble with strings/number formats/arrays, etc. Thanks
Solved! Go to Solution.
11-04-2012 05:45 PM
Try reading the file with the Read From Spreadsheet File.vi with Transpose set True. Then use Array Max & Min to get the largest number in the array.
Lynn
11-04-2012 06:00 PM
Yes, that works. I guess I couldn't get past the thought that my text file is not a spreadsheet, and so I assumed that read from spreadsheet vi would not work. Thank you.
11-04-2012 06:09 PM
The spreadsheet functions and VIs typically work on strings representing numbers separated by delimiters. This is a typical way to save a "spreadsheet" (of numbers) to a text file, for example .csv files. These are quite versatile and powerful functions. Spend a bit of time becoming familiar with them because you may find yourself using them a lot.
Lynn
11-04-2012 06:31 PM
Right on. Now, do you have any idea how to delete text files from an sd card? After I grab the data, I want to wipe the sd card clean from labview with a button and be on my way.
11-04-2012 06:44 PM
File I/O palette >> Advanced File functions >> Delete File.
The SD card should have a drive letter assigned, so you just use that in the path you send to the delete file function.
11-04-2012 07:06 PM
Yes, thanks