LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

If file exists create a new file...

Solved!
Go to solution

Hello,

 

I am trying to use Labview to make a filing system. When it goes to create a file that already exists, I want a number to be concatinated on to the end of the file. For example if I save Untitled, I want it automatically to create Untitled-1. And if that exists also, I want it to be able to just automatically create Untitled-2. And golly if that exists too, I want this to be able to keep going on for quite a while. Is there an easy way to code this in Labview?

 

Thanks in advance!

Cassidee

0 Kudos
Message 1 of 5
(4,244 Views)

shouldnt be too hard, what have you got so far?

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 2 of 5
(4,235 Views)

There's a handy VI written by a forum user here.

 

There's a VI called Check If File Or Folder Exists in the File I/O Palette which spits out a boolean that is true if it finds a match and false if it doesn't. With a case structure built from this, you can do pretty much anything you want.

---
CLA
0 Kudos
Message 3 of 5
(4,229 Views)

Just to get you started...

 

The key here is knowing that you will get an error (7) if the file does not exist.  So you will need to add an additional check before this code to see if the file exists.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(4,225 Views)
Solution
Accepted by topic author cassidee21

Find the attached prototype (saved in LabVIEW version 2009)

 

Prototype.png


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


Message 5 of 5
(4,214 Views)