cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting File with a File Name that Changes

RineshSingh
Level 3

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

1 BEST ANSWER

Best Answers

MarcinDabrowski
Level 3

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)

36326.png

Run the stage - it will populate with the file names.

36327.png

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

View answer in original post

1 REPLY 1

MarcinDabrowski
Level 3

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)

36326.png

Run the stage - it will populate with the file names.

36327.png

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