04-21-2010 12:12 PM
Hi,
I have a question regarding writing to file. Currently in my program, when I start running it, a dialog box pops up and the user gets to pick/ create a file. My data is written on to a file as columns. I want to add column names to the file. Any suggestions on how to do it? Since the file is created by the user at run time and since the column names have to be added just once at the beginning, I'm not sure how to go about doing this. Any suggestions or pointers?
Thanks,
Sukanya
04-21-2010 12:49 PM
Sukanya,
I guess it depends on what kind of file you are writing. For instance, if you need to write a 2D array of numbers to a text file (ie, CSV file equivalent of Array to Spreadsheet File.vi):
If you need to write the data as you go, your can either pile it up in memory as you go and then do the procedure above, or you can write it out to the file and then open the file and pre-pend the column headers as described above and the replace the file contents.
I know, seems messy. I agree. Does this help?
-cb
04-21-2010 01:17 PM
Here is a way to write headers once and then append data on the fly:
02-11-2014 11:37 AM
dear sir
i wanted to ask you help. i saw your program bt i am having a big problem
here is my VI. i actually have to do a database where there is the name of the student,
date of equipment of borrowal. time of the equiment when it was borrowed and its date
but when am doing this. each time i always have to create a new file each time.
i cant use the only onw file.:(
and also my 2nd problem is that when the output is being yielded, it is repeatedly
givine me the same output twice, thrice and a lot like in the pic below
help please
02-12-2014 05:16 PM
Hi Zahkay,
Can you please attach your code to this forum? Instead of just an image. I would like to recreate your issue myself.
I do notice that you are not specifying a file path in your first Open/Create/Replace File function, if you do this, then this should solve your first problem of LabVIEW creating a new file each time.
Are you using excel? In order to append the data to the end of a file in excel, you can look at the document below, which shows you how to do this.
http://digital.ni.com/public.nsf/allkb/EFCE1C25DCE7483E86256CAF00539451?OpenDocument
This document is a good starting place, please let me know if you have any questions.
02-12-2014 10:58 PM
thank you very much sir.
which version of labview are you using. i will upload accordingly to what you can open.
i am using labview 2013. yeah sir it is excel.
02-13-2014 09:01 AM
sir there is some icon inside the vi that is not present in my toolkit
can u please let me know which toolkit to use
02-13-2014 10:39 AM
Hi Zahkay,
You can open up context help (Ctrl+H) and hover over the icon in question. It will display the name of the icon. Please let me know what is the exact name of the icon, and I will be able to tell you which toolkit to download.
Thank you,
02-13-2014 10:47 AM
hello sir
Referring to the first example from the link you send me
sir like
excel insert cell
and
excel easy table
02-13-2014 10:47 AM
hello sir
Referring to the first example from the link you send me
sir like
excel insert cell
and
excel easy table