11-04-2011 05:57 AM
I have programme for analysis of a one data file, now i want to make the programme if there are 100 no of file so that programme will work on that file one by one,,
is it possible?
11-04-2011 06:03 AM
Post your code what you have done so far. So, some one will help you.
11-04-2011 06:34 AM
To do it, you will have to use a "list folder" VI present in advaced file functions of function pallete. This VI will list all the files and folder present in a specified location in two different arrays ( one array has list of all file and the other one has list of all folders). Once you get all the files, you can analyze those files one by one in a for loop.
Regards,
Prashant
11-04-2011 06:36 AM
Check the screen shot
11-04-2011 07:32 AM
thanks for suggestion , if you have any example please send me.
regards
prince
11-04-2011 07:38 AM
Here i have attached my programme ,, which is aplicable for the file attched with same post,,,
but i want make it if i have 100 no of similar file so that programme will work for all file one bye by one click,,
11-04-2011 08:00 AM
As PCSNF stated in an earlier post, you will need to wrap your code in a loop to repeat the parsing process for all the files.
Also it is good practice to use the Buld Path function from the File palette rather than maniplating strings to get your path. Did you want the path to be "parsed.txtPrased.txt.txt" ? That is what your code generates. Put an indicator on it and look.
Lynn
11-04-2011 08:05 AM
don't want to pars the file i just want to run thprogramme at one and give a folder to that programme , which folde having multiplee noumber of files , so that wil take file one by one and run them similar for all,
11-04-2011 10:57 AM
Here i have attached my programme ,, which is aplicable for the file attched with same post,,,
but i want make it if i have 100 no of similar file so that programme will work for all file one bye by one click,,
11-04-2011 11:13 AM - edited 11-04-2011 11:23 AM
Overall, your code can probably be simplfied, but here's a quick draft that lets you select a folder and process all *.txt files in it.
I also thing you could just write the "resulst string" directly to a plain text file. coverting to an array for a nanosecond just to convert it back to what it was inside "write to spreadsheet file" seems a little detour, unless you really want to see the 2D array during execution. I would also delete all indicators, they change very rapidly and just slow down the loop.
(I did not test the code, so there could be bugs. Modify as needed)
(btw, never operate on paths as strings. it will break OS independence. Always use strip path/build path)