01-04-2019 07:36 AM
01-04-2019 10:27 AM
@edmund99 wrote:
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.
To get the "header" information written every time your vi runs keep the code in the case structure but remove the case structure. Based on your picture from your second post this seems to be what you want??? Each time the vi runs on the same file it will insert a new "header" line with "Date","Time", etc.
01-04-2019 07:57 PM
@GerdW wrote:
Hi edmund,
when I run your VI and let it create a new file then the header line is written…
Hi GerdW hod did you manage to get the headers written? I cannot get it still....
01-04-2019 08:04 PM
Hi this is what i want to achieve..... I do not want to have multiple headers . Just one row will do. For now i must manually enter the headers into the CSV file , I want to automate the process and not have multiple row of headers, just one row at the top of the CSV file will do
01-05-2019 09:17 PM
@GerdW wrote:
Hi edmund,
when I run your VI and let it create a new file then the header line is written…
Hi all when i tried running Mr Sarbari's vi first and then letting it create a new notepad text document
i got what i wanted, which was auto generating the headers at the 1st row. The image i attached bellow are the types of files that can be created when i run my vi then create a file.Just wondering is there a way to create a csv excel file ? Or i have to manually export data from my text document to my excel csv?
01-05-2019 09:35 PM
There is no such thing as a "Notepad" text document. There is no such thing as an "Excel" CSV file.
Both are text documents. Any application can open them assuming it knows what to do with the text data inside. What you consider is a "Notepad" or "Excel" type of document is probably how the operating system associates particular file extensions with particular applications so it will automatically open in that application when you double click.
So a text file with a ".txt" extension will open in Notepad under the typical Windows association. A text with a ".csv" extension will open automatically in Microsoft Excel, typically. Excel doesn't make a CSV file particularly special. It is a completely different file format than a Microsoft Excel ".xls" file or an Excel ".xlsx" file, which are also different from each other.
01-07-2019 05:36 AM
A CSV is a Comma Separated Values-file. It's a text file with the same format as your posted .txt, so all you need to do is change the extension from .txt to .csv.
/Y