08-11-2018 07:09 AM
HI
I am trying to open a folder which contain many folder so I would like to select the folder that I need and get the final text file ,, so I tryed with this program but it's not function
can you help me please .
08-11-2018 10:37 AM
Why are you concatenating spaces to the beginning of many of your strings?
You should also be using Build Path rather than strings and concatenation to actually build the paths.
08-13-2018 06:46 AM - edited 08-13-2018 06:47 AM
Since you have a repeating pattern, perhaps you should be using a FOR loop.
08-13-2018 11:51 AM
I think the reason the code isn't working is that it is doing what you told it to do, not what (I think) you want it to do. I don't know how you've named your Folders, but I'm assuming that if you have a Control called "année", a reasonable folder name might be "2018". But if you set the Year Control to 2018, it is going to try to return the 2019th folder name, probably not what you want.
This entire VI looks like an example of "throw down some code first, think later". Try reversing the order.
Bob Schor
08-14-2018 09:38 AM
HI
08-14-2018 10:07 AM
I would use Format Into String, with Year, Month, Day, and Filename as inputs. You could (should?) put checks in to be sure the input parameters "made sense" (i.e. Month was 1..12, and Filename obeyed certain rules, such as "always had extension .txt" or "always had no extension" or "add .txt if no other extension"). For a full path, you might also want to add the path to the Top Level Folder (e.g. C:\Users\Me\My Documents\My Data).
Bob Schor
08-14-2018 11:05 AM
HI
thank you for your reply , but actually I didn't undrestand you how can I put this icon
thank you
08-14-2018 11:18 AM
re you talking about the "Format Into String" function? It can be found on the String Palette --
You drag whatever you want to format into a string into the bottom input, dragging down the bottom edge of the function if you need additional inputs. The Function will recognized whether you are inputting a number, a string, or whatever. You can then right-click it and choose "Edit Format String" (the series of characters coming in on the top". I chose to display Year as a Decimal, Month and Day as 2-digit decimals with leading 0, and the Filename as a String. To insert the backslash, I just put in a backslash, but since this is a "special character", I needed to "escape" it with another backslash. You can read more about this function by right-clicking it and choosing Help.
Bob Schor
08-14-2018 11:47 AM
HI
thank you
actualy I am thinking to use a property node , but I didn't find it can you help how can I get the item name ,, actually when I select create -> property node I didn't find the appropriate property (NomsÉlts {items names}, ..)
08-14-2018 12:57 PM
I was wondering where Property Nodes came in, then I realized that I probably didn't understand what you really wanted to do. Let me try again (I'm going to, again, be "guessing", but you can correct me if I'm wrong):
A Path Control with a Browse Option set to Existing Folders can be used to search for and select the Top Level folder. For the Year, Month, and Day folders, you can use a Path Control with Browse Option, and use a Property Node to set the Start Path to the previously-found Folder Path. Note that this will show all Folders, including those that might not be named with 4 or 2 digits. Finally, you can use a Path Control with Browse Option set to Existing Files, and Pattern set to *.txt, to find the final File, which should return the full Path to that file (which, I think, is what you want).
Bob Schor