07-16-2018 04:47 AM
Hi! I'm working on a project to get frequent readings and would like to sort the data based on the date and time in the excel sheet. I am using delimited spreadsheet and I tried building a filename but came up with error. It would be really great if anyone can suggest an idea! 🙂 Thank you very much!
Solved! Go to Solution.
07-16-2018 05:47 AM
07-16-2018 08:08 AM
As Gerd said, you have no filename connected to the Open file function, so i bet your error is "Not a path", right?
/Y
07-16-2018 12:35 PM - edited 07-16-2018 12:37 PM
None of the code on your truncated picture shows any "building" of any file name, thus the picture seems unrelated to the problem. Please show us the relevant code instead.
(I am sure you could refactor so the sequence structure can be eliminated. What's the difference between "file path 2” and "file path 3"?)
07-16-2018 12:38 PM
I like to have the file names auto generated and usually do something like this:
This creates a file name like: HiQ_Raw_Data_Tuesday_June_26_2018.txt
(full path C:\HiQ_Data\HiQ_Raw_Data_Tuesday_June_26_2018.txt)
07-16-2018 01:48 PM - edited 07-16-2018 01:52 PM
@RTSLVU wrote:
I like to have the file names auto generated and usually do something like this:
I do something similar, except I just use the Format Date/Time String function and I format it to be YYYY-MM-DD and put the time in there too. This way, it auto-sorts by date/time.
07-17-2018 04:31 AM
@GerdW wrote:
Hi raghav,
supply a file path for that FileOpen function!
but came up with error.
Which error?
What did the error message say?
Why do you attach just an image - but no VI/snippet?
Hi! I did supply a file path, but it overwrites for every run of the program. So I kept it unwired and created a file everytime. I have attached the VI with this message. 🙂 Sorry I forgot to attach it before.
07-17-2018 04:46 AM
@Yamaeda wrote:
As Gerd said, you have no filename connected to the Open file function, so i bet your error is "Not a path", right?
/Y
Yep, but before that I did try giving an existing text file path to the program. But like I told Gerd, it's being overwritten for every run of the program. 😞 I would like to save it as a new file everytime, so I removed the path and made it open the dialog box everytime.
07-17-2018 04:50 AM
@altenbach wrote:
None of the code on your truncated picture shows any "building" of any file name, thus the picture seems unrelated to the problem. Please show us the relevant code instead.
(I am sure you could refactor so the sequence structure can be eliminated. What's the difference between "file path 2” and "file path 3"?)
Hi, I've attached the code with this message. Sorry I forgot to add it previously. The names are just automatic filenames given by LabVIEW. I could not make it save as a different document everytime when I wired the filepath, so I kept it unwired as it would open the dialog box everytime and ask the filename to be created, but it's pretty tedious, so I'm looking for an alternative with a predefined new filename. 🙂
07-17-2018 05:15 AM - edited 07-17-2018 05:17 AM
Hi raghav,
when you want to append new data to the end of your file you should set the file position to the end instead of the start.
Seems reasonable, don't you think!?
(Judging from the image in your first message as I cannot open your LV2018 VI.)