07-12-2024 07:49 AM
Hi,
Thanks. Yes.
Its working only single cell value. I will check it further. I need to copy 10 locations from the file.
07-12-2024 09:53 AM
What is the ultimate "output" that you desire? Are you looking for a "written Report", say, a Text file with outputs from various tests nicely formatted in rows and columns, with each Test preceded by a Serial Number, or do you want something to view on a screen that you can scroll around and see?
I basically like @RamonG's use of a LabVIEW Table indicator which provides "alignment" possibilities, but the example he posted might not work with (some of) your Data Files. For example, the Serial Number might not be on Line 13 (counting the top line as Line 1), and the number of sensors might not always be 10.
The Good News is that Read Delimited Spreadsheet (using a comma as the separator instead of the default <tab>) will, indeed, get all of the comma-delimited data into one large 2D (string) Array (assuming you chose the "String" form of Read Delimited Spreadsheet). Now you can parse this array, looking for entries such as "SERIAL NUMBER" in the first (which I should call Column 0) column, and saving the (very long!) string found in the second column. [You may or may not want to indicate, either as a separate column in the Report, that this is a Serial Number, and you'll probably also want to have a line that identifies which of the many Data Files these data come from].
You'll now need to parse the rest of the Report, looking for (say) a Blank line that separates various Tests. I see a Test Summary -- do you want that? Do you want a Test Identifier for the subsequent Tests in the Report? Do you want to include all the Test Data, even if it is more than 10 entries? How do you want the Report to be formatted (I'm guessing you'll want test data to be viewable as "columns", possibly right-justified, which is the default if the Data being placed in the table are really numeric, despite being read as strings (the Scan from String function Is Your Friend here).
Here is an idea that I've used when I've had data files that I wanted to save as text files for users who were more familiar with Excel and being able to read Text files -- I used Write Delimited Spreadsheet to output the mixed text-and-numeric data as a "delimited Spreadsheet", using a <tab> as the default separator.
To make this file "look pretty", I followed the following rules:
The nice thing is once you written the code to write this human-friendly data file, it is relatively straight-forward to engineer it to read this file and recover specific data (using Headers, if appropriate).
Bob Schor
07-12-2024 12:04 PM
Hi,
This is Vi
This is the out. Everything is ok except Header name. Serial Number
csv file out put
Expected csv out put as below. Check Highlighted color
07-12-2024 12:42 PM
Create an Array of String that has what you want in the Header Row ([Serial Number, S1, S2, ... S40]). Before you write the 2D Array of all of the Data, write the 1D Array that is the Header Row.
You do two writes -- one for the Header Row (here with "Serial Number" in the first column and then 20 columns S1 to S20 (you can make it 15, or 30), write it to the Output File first, then write all the data files as you have accumulated them.
Bpb Schor
07-12-2024 03:13 PM - edited 07-12-2024 03:13 PM
@Maheboob wrote:
Hi,
This is Vi
This is the out. Everything is ok except Header name. Serial Number
You don't need to wire all these indices, the 29 is all you need. Don't clutter the diagram!
Even simpler, just do the array subset!
If you want headers, use another built array before writing the file and wire a 1D string array containing the headers. (A string array diagram constant if they are fixed, or else read from wherever that info is kept)
07-13-2024 01:03 AM
Dear Bob,
Please find my VI.
Please let me know how can i proceed further in order to get Header names. I really appreciate your support. Thank you.
07-13-2024 01:20 AM
@Maheboob wrote:
Dear Bob,
Please find my VI.
This is based on my suggestion, not Bob.
I already told you how to write the headers. I can't tell you where to get them because I don't know where the are.
07-13-2024 01:34 AM
Hi,
I am new to LV, just I know the basics of LV. I tried with your suggestion but it not working.
All serial numbers appearing before column. Can you create VI for me from my last VI to get the header names. Please refer my earlier email and attachment. Thanks
07-13-2024 09:02 AM
@Maheboob wrote:
I am new to LV, just I know the basics of LV. I tried with your suggestion but it not working.
There are billions of possible ways something is "not working". You need to be more specific.
@Maheboob wrote:
All serial numbers appearing before column. Can you create VI for me from my last VI to get the header names. Please refer my earlier email and attachment. Thanks
I don't see any emails and this is a very long thread with many conflicting statements. Assuming the header you want is just [Serial Number, Sensr1, Sensor2, ... Sensor 10], here's one possibility:
07-13-2024 09:27 AM - edited 07-13-2024 09:30 AM
Here I use an array of files (I repeat the same file here, because you only attached one. You will have an array of file from "list folder", as shown earlier, of course and all files will be different)