Hello All
The attached vi searches a directory which contains txt files with the name format File_2011.02.17.txt...viz the file is named on the date it is created.
The purpose of the directory search is to determine if a file already exists....if it doesn't, then something else happens (this part of the code is not included nor is it relevant)
The date part of the file is created using the Get Date/Time in seconds format.
After searching the directory and finding the latest txt file I am then attempting to compare it with the current date.
This is where I'm having a little trouble, and would appreciate any assistance.
I'm sure it's a very minor thing to do, but I've always had trouble with timestamps, dates etc.
Thank you and best regards
Ray
已解决! 转到解答。
You can use a simple regular expression to extract the date components from the file name. Then you can convert them to numbers and compare then at will. I would recommend calculating a Julian date from the components so you only need to do one comparison.
Hello Mark
Firstly thank you for your interest
I assume the function you have used here is a Match Regular Expression. I'm using LV2009 on XP, and this function I have looks different to yours. For a start it doesn't have the three seperate string outputs on the right hand side, but rather....before match, whole match and after match.
Am I missing something here?
Ray
The Regular Expression function can be expanded by grabbing the bottom of the function and pulling down (like many other LV functions)
You could also drag Mark's example from your browser and drop it on your block diagram, it's called a VI Snippet.
Phillip
That process doesn't work for me.
See attachment for what drops onto my BD
R
Mark
I took your advice on all counts and it works. It may be convoluted and a knight could do it in half as many functions (have a look) but it does work.
Thanks again
Ray
Then please give credit to Mark for giving you the solution by marking his message as the solution and not your own. You can unmark your message by going to the options menu to the upper right of your message.
@rayclout wrote:
Phillip
That process doesn't work for me.
See attachment for what drops onto my BD
R
I'm guessing you are using Firefox or Chrome. I think there is a known issue with these browsers. Internet Explorer should work.
By the way, I just upgraded my home laptop to IE 9 and now I can't drop a snippet using IE either ![]()