12-20-2011 12:43 PM
@TSCline wrote:
I am still learning labview as quickly as I can so thanks for the feedback. I don't understand why you call it a path constant called string. It's pink and appears as a string constant on the front panel.
12-20-2011 12:43 PM
Here is the original path constant, then the string control, and then the path as it enters the open/create/replace function
12-20-2011 12:43 PM
@TSCline wrote:
Yes the result in the error is exactly what it should be. All the string control contains is the number 1.
What I am trying to do is update a file. I collect data periodically and want to add the contents into a file. right now it essentially replace the old file with a new one of the same name. Since I store the data in the array it accomplishes what I want but in a poor way. What is the best way to add data onto an existing file. Do I need to open it, read it into an array and then add onto it? Your help is very appreciated
Are you sure there are not any control characters (none printing) in the path?
Show us the resulting value of the path.
If you open the file once and keep it open, each write will append data to the end.
But if you open the file, write some data and then close it and if you re-open the file you will need to set the file position to the end of the file to append new data to it. Other wise it will over write the old data with new data starting at the beginning.
12-20-2011 12:45 PM
sorry sorry sorry it looks like i sent the wrong picture
12-20-2011 12:50 PM
do you just use the close file function outside the while loop with close excecution? or with the the other way what function is used to set the file position?
12-20-2011 12:53 PM
What is the correct path supposed to be? Is there supposed to be a space between "December 20" and "Water Vapor", or is "Water Vapor" suppose to be a sub-directory? Is there supposed to be a space before "1"? If those are supposed to be subdirectories, you appear to be making the classic mistake of trying to use string operations to create paths. That's why you should be using the file functions to build paths, not string concatenation functions.
@TSCline wrote:
What I am trying to do is update a file. I collect data periodically and want to add the contents into a file. right now it essentially replace the old file with a new one of the same name. Since I store the data in the array it accomplishes what I want but in a poor way. What is the best way to add data onto an existing file. Do I need to open it, read it into an array and then add onto it? Your help is very appreciated
Why not just use the Write to Spreadsheet File VI? It has an "append" input.
12-20-2011 12:56 PM
i didn't know about the append input on the write to spreadsheet file. That will work best for me. Thank you
12-20-2011 01:06 PM - edited 12-20-2011 01:09 PM
You are creating a folder that looks something like
"C:\Users\Hansen Group\Dropbox\HEP Self-Reaction\December 2011\December 20" inside the Create New Path subVI
So I think your file path should look something like
C:\Users\Hansen Group\Dropbox\HEP Self-Reaction\December 2011\December 20\Water Vapor Concentrations1
I think you are missing the '\' before "Water Vapor Concentrations1"
From your last post I see the problem. the Create New Path VI is creating a new folder or directory and not a data file.
Then when you try to open the directory as a file to write data to it, a directory is an invalid file type. A directory is a directory and not a file that you can write to.
07-24-2013 04:25 AM
Hi,
Sorry for the intrusion
I have a problem with an append path from the "build path" function.
Built the path, it enter in "list folder" function but does not pass through the tunnel of the for loop.
Instead, if I wire a path controll to the "list folder", the path pass through the tunnel and the vi run as it should.
I attach the image of my VI so you understand better.
Please... Help me!
07-24-2013 05:03 AM
gmazza,
What does 'List folder.vi' return at the 'path out' terminal then?