08-15-2024 07:48 PM
Hello Guys, i have a issue
i'm creating a report file on .csv using the "write delimited spreadsheet" it works good but i want to create multiple reports with diferente name
Example
Test report 1
test report 2
saved on the same folder
but right now i can save the information on the same file but with the new information
if someone can help me with this, i'll appreciate it
Solved! Go to Solution.
08-15-2024 08:38 PM
You can use Check if File or Folder Exists VI to decide if you want to increase the index of the file name.
You can also generate the file name using date and time. This will prevent any possible duplication. Creating File Names Programmatically Using LabVIEW
08-16-2024 01:56 AM
@Ignacio564 wrote:
Hello Guys, i have a issue
i'm creating a report file on .csv using the "write delimited spreadsheet" it works good but i want to create multiple reports with diferente name
Example
Test report 1
test report 2
In 'File IO' -> 'Advanced File Functions' there is a VI which helps you with this: 'Create File with Incrementing Suffix.vi'.
08-16-2024 08:09 AM
First, remove the Sequence structure (you will almost never need it until you start writing LabVIEW code to run on an FPGA), and connect your two Write Delimited Spreadsheet functions with the Error Line (Error Line In on the lower left corner, Error Line Out on the lower right corner). Keep the Error Line (and other wires) as straight and running left-to-right as you can.
Second, to create files with different names, specify different names each time you write the file. One way to do this is to create the File Name using an incrementing integer (like the index of a For or While loop), passing it as the numeric input to a Format Into String function (found on the String Palette) having a Format String (a String constant you put there) containing the string "D:\datafile %d.csv" without the quotation marks, and which you pass through a "String to Path" function (found on the Files palette, possibly in Advanced functions). The basic idea is if you want a different name for your File, you need to create the different name, yourself (with LabVIEW's help, such as the auto-incrementing feature that they also provide and that others have suggested).
Bob Schor