Convert a TXT file into CSV format in Pega Robot Studio

Hi all,

I need to convert a txt file with its contents into a CSV file in pega Robot Studio v19.1.27.0

Currently, I am converting the txt file by using an Excel connector. (Save As Method)

But, this creates an empty csv file in the intended location.

TIA

Can you share an example of your text file? You may edit any sensitive data out and replace with random data. Does the file need to be changed in anyway, or are you just changing the extension of the file? If it is the latter, then you can just use the FileUtils to rename the file. If it needs to be changed, then you’ll likely want to use a C# script to alter the contents. I don’t think performing a SaveAs using the Excel Connector would actually convert the file.

I have attached a sample txt file. The file needs to be changed anyways, not just the extension.

I have followed this approach also. But unable to read the contents. The output was given as shown in the image.

Output:

Sample Text.txt (347 Bytes)

If you simply use Excel to convert that file to a CSV, you get the following. Is this what you want?


GLOBAL TECHNOLOGIES (pvt) LTD,
,
Ship To: ,
+91 88 849 9384,
“52/1, Flower Street, USA”,
,
Billing Address:,
+91 88 849 9384,
“52/1, Flower Street, USA”,
,
Details:,
,
Column A,Column B,Column C,Column D,Column E,
Value A,Value B,Value C,Value D,Value E
,Total,Value F
,
Please do the complete payment on or before 21/11/2020.,
,
Thank you,

Hi @sasnt ,

Sorry for the late reply. The reason I didn’t convert it directly was that some invalid characters were getting generated with the text.

However, I was able the achieve this with the use of a script.

Thanks for the assistance.