LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic creation of headers in CSV file if there is no headers

Solved!
Go to solution

Hi all i would like to ask how can i make my programme automatically create headers for my csv file if the file has no headers in it.

 

i have tried to troubleshoot on my own but to no avail.

 

For the "test excel(1).vi" file, the headers will be generated every time i run my vi( repetition of headers)

 

For the"test excel(2).vi"file, the headers must be manually entered into the csv file.

 

Download All
0 Kudos
Message 1 of 17
(2,798 Views)

Results of test excel(1).viResults of test excel(1).viResults of test excel(2).viResults of test excel(2).vi

 

0 Kudos
Message 2 of 17
(2,796 Views)
Solution
Accepted by topic author edmund99

Here you go with that solution, It might help!

CSV Auto Header.png

Message 3 of 17
(2,791 Views)

Hi thanks Mr Sabari , may I know what is the vi you placed at the case selector of the case structure? 

0 Kudos
Message 4 of 17
(2,779 Views)

Hi Edmund,

 

2 hints:

- it's a comparison function...

- it's used to test an array...

 

One more hint:  sabari attached a snippet!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 17
(2,766 Views)

@edmund99 wrote:

Hi thanks Mr Sabari , may I know what is the vi you placed at the case selector of the case structure? 


It's a Read Delimited Spreadsheet.vi. If you got a solution kindly accepted as a solution. So, no more conversation wouldn't go about this topic.

0 Kudos
Message 6 of 17
(2,753 Views)

Hi Mr Sabari this is the vi that i wanted to ask you about

0 Kudos
Message 7 of 17
(2,746 Views)

That's an empty array.

Message 8 of 17
(2,741 Views)

its "Empty Array?" function in comparison palette. if read file function returns empty array, then write header (1st case structure)

CY (expired CLAD)
Message 9 of 17
(2,745 Views)

Hi i am still unable to generate headers in my excel.

ylx.JPG

0 Kudos
Message 10 of 17
(2,727 Views)