cancel
Showing results for 
Search instead for 
Did you mean: 

Getting File Names and Writing them to Text File

Former Member
0 Kudos

Hi,

I am trying to get the File names by Get_File_List action block from a folder in WEB and then by using a Repeater and a Write_File action block to write those names in a text file in WEB.

Somehow it is not displaying in the file whereas while applying a Tracer it displays the name of the file.

Any suggestions on why this is happening?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I tried this scenario and it worked for me.

Pls find the transaction as shown below.

In the Write File action block configuration provide file path and select mode as create. this will create the txt file of filenames.

Add  GetFileList action block and in its configuration provide folder path and Extension


Add a Repeater action block and provide the Path of the Row from the result set of GetFileList


Add WriteFileList action block , this time in Append mode so that file names will be keep on appending once they are fetched from repeater every time.


Links of WriteFile action block which is under repeater should contain the expression which will provide the file name which needs to be written/appended.

After running the above transaction you can see all the file names are written to the FileNames.txt file

Hope this helps.

Regards,

Sriram

Former Member
0 Kudos

Hi Sriram,

Thank you for the reply. I actually got it to work in a different manner by using a Transaction parameter and an Assignment Block with writing an expression as "Transaction.FileName&","&Repeater_0.Item{/Row/Name}".

By the way, you don't have to write the first Write_File block as whenever you create Write_File action block in APPEND mode, it automatically creates a file specified in the path.

Anyway thank you.

Former Member
0 Kudos

Yes That is more efficient way of doing this

Answers (0)