12-25-2011 08:48 AM
Comment je peux avoir le nom du fichier le plus récent (ayant la date de modification la plus récente) ?
How can i get the name of the latest created or modified text file ?
Thx for help.
12-25-2011 09:43 AM
Hi Nizartun,
You can use file/directory info VI.
Regards,
Bijay
12-25-2011 09:57 AM
@Bijay wrote:
Hi Nizartun,
You can use file/directory info VI.
Regards,
Bijay
To expand on that you can use List Folder for all files in the directory, then use a For loop with File/Directory VI and read the last modified date, looking for the newest file in the directory.
12-25-2011 10:15 AM
Hi all,
Yes thats right.
Regards,
Bijay
12-25-2011 11:54 AM - edited 12-25-2011 12:00 PM
(BiJay: That will not work unless both folder paths are the same. It is a bad idea to have identical diagram costants scattered all over, because any change in code would need identical changes in several places, creating a maintenance headache and potentials for error.)
You need to wire the folder path from the outside to the inside of the loop. Then you also need to sort by modification date to get the newest file.
This assumes you only want *.txt files. Change the pattern if needed.
Here's a quick snippet.
01-01-2012 09:49 AM
Thx to all of you
03-13-2012 02:27 AM
Hi altenbach,
Could you please post the vi file for this?
What is the block with a hour-glass, and also the block with a black arrow and the green word "path"?
Thank you.
03-13-2012 09:58 AM
Bundle function and Unbundle by Name function.
03-13-2012 12:01 PM
splee wrote:Could you please post the vi file for this?
The image in my post is actualy a LabVIEW snippet. You can simply drag it to the block diagram of LabVIEW 2011 and it will turn into fully functional code. Try it.