03-13-2014 03:46 PM
I want create a new folder named by time, and then generate a txt file inside this folder: reads in the header information first and then reads in data, but the problem is that if there exists this folder, the header will appear in the file, if this folder is not existed, the header will not appear in the txt file.
Thanks for your help.
Solved! Go to Solution.
03-13-2014 05:13 PM
Have you tried the Check if File or Folder Exists function (found on the Advanced File Functions on the File I/O Palette)? If your folder does not exist, create it. Now you know you have a valid folder, so build your path by using the Folder and your desired File Name. You are using Build Path, aren't you?
03-13-2014 06:48 PM
My aim is to create a new file and within the same run write header info.(using Write to file) and data (using Write to Measurement file) into the txt file inside the folder.
I create the path by combining the input file path and time.
I'm not sure I understand your meaning. I'm so sorry.
03-14-2014 01:00 AM
Hi Junniji,
Check the attached vi. I have done what Bob was trying to explain in the vi. I have documented the steps in the block diagram. Have a look. I had few comments on your code as well. Always try to connect the error wires when coding and try to keep the code neat so that its easy to debug and understand the flow (even if it is a test code :)).
There was a subvi missing in the vi which you sent. I hope you'll have it in your pc 🙂
regards,
Nitzz
(Give Kudos To Good Answers, Mark it as a Solution If your Problem was Solved )
03-14-2014 09:02 AM
It works. I'm so happy that my first project finally works.Thanks very much. And also thanks for your advise.
03-17-2014 02:43 AM
Hi Junniji,
We all are always happy to help.. 🙂
regards,
NitzZ