05-02-21 04:58 PM
10001_LIT_TEN_NO_SUPPLIED_RESULTS - 2020-12-15_SEQNO_14790.txt
I need to be able to search for the above file name from a list of file in a folder. The issue I am having is that parts of the file name change each day.
The inly parts of the file name that do not change are the are as per below:
10001_LIT_TEN_NO_SUPPLIED_RESULTS –
How do I ensure that my CSV pattern in "Get Files" caters for this, so that BP only picks up files that have these non-changing characters?
I have managed to get these files into a collection using *.txt but this returns everthing which is 1000s of files.
Thank you
Ree
Answered! Go to Answer.
05-02-21 04:59 PM
Hello Ree,
I have ran a test on my system using the BPC file utility- all works fine.
Example source files in my test folder:
10001_LIT_TEN_NO_SUPPLIED_RESULTS - 2020-12-14_SEQNO_14790.txt
10001_LIT_TEN_NO_SUPPLIED_RESULTS - 2020-12-15_SEQNO_14790.txt
Then i used 'Utility - File Management' Action: "Get Files"
Input:
Folder: (this is the folder where you store the files, ending in "\", as text value in quotations) e.g. "C:\TestFolder\files\"
Pattern CSV: "10001_LIT_TEN_NO_SUPPLIED_RESULTS*.txt"
Output:
Success: Flag data item , I named it: Load_test
Message: Text data item, I named it: Message_test
Files: Collection data item, I named it: Files list
(Use the little block to the right, to auto create the data items)
Now, open the collection data item, and add fields:
Name (text), Path (text), Folder (text), Extension (text), Created (date), Last Accessed (date), Last Written (date), Read Only (flag), Bytes (number)
Run the stage - it will populate with the file names.
Have you checked your collection has all the required fields, and have you added the closing slash "\" in the 'Folder' input parameter in 'get files' action?
BW
Marcin
05-02-21 04:59 PM
Hello Ree,
I have ran a test on my system using the BPC file utility- all works fine.
Example source files in my test folder:
10001_LIT_TEN_NO_SUPPLIED_RESULTS - 2020-12-14_SEQNO_14790.txt
10001_LIT_TEN_NO_SUPPLIED_RESULTS - 2020-12-15_SEQNO_14790.txt
Then i used 'Utility - File Management' Action: "Get Files"
Input:
Folder: (this is the folder where you store the files, ending in "\", as text value in quotations) e.g. "C:\TestFolder\files\"
Pattern CSV: "10001_LIT_TEN_NO_SUPPLIED_RESULTS*.txt"
Output:
Success: Flag data item , I named it: Load_test
Message: Text data item, I named it: Message_test
Files: Collection data item, I named it: Files list
(Use the little block to the right, to auto create the data items)
Now, open the collection data item, and add fields:
Name (text), Path (text), Folder (text), Extension (text), Created (date), Last Accessed (date), Last Written (date), Read Only (flag), Bytes (number)
Run the stage - it will populate with the file names.
Have you checked your collection has all the required fields, and have you added the closing slash "\" in the 'Folder' input parameter in 'get files' action?
BW
Marcin