cancel
Showing results for 
Search instead for 
Did you mean: 

How to get file name from a list

former_member280200
Participant
0 Kudos

Hi,

I am using a wait_for_file function to check if a file has been delivered, this is my function below:

$G_FileFound = wait_for_file($G_FileLocation||$G_FileName,

                                                $G_TimeOut,

                                                $G_Interval,

                                                 -1,

                                                $G_ListOfFiles,

                                                 $G_NumOfFiles, ' | ');

The function works as expected.  This is the result of the function:

     File exist:                      1

     At         :                     /SHOP/

    Num Of Files    :                3

     List Of Files:                   /SHOP/order_data_FULL_20150513.csv |

                                           /SHOP/order_lines_FULL_20150513.csv |

                                          /SHOP/product_FULL_20150513.csv

My question is, I would like to extract the name of each file from the list of files so I can create a record in my audit for each of the file that I received.  Does anyone has any idea how to do this?  Its probably simple but I am stuck at this point.

TIA.

Accepted Solutions (1)

Accepted Solutions (1)

former_member187605
Active Contributor
0 Kudos

Loop over the content of  $G_ListOfFiles ($G_NumOfFiles times) and use word_ext( $G_ListOfFiles, $Loop_counter, '|') to retrieve the individual file names.

former_member280200
Participant
0 Kudos

That works exactly as I wanted.

Thank you.

Lynne

Answers (0)