cancel
Showing results for 
Search instead for 
Did you mean: 

Problems in LoadTextFile

dbellazzi
Level 3

Hi everyone,

I'm having trouble translating an .xlsx file into text using the LoadTextFile function. I also tried using the "Read All Text from File" task in the "File Management" object.
What I get is 17753 characters but if I try to retrieve the "Current Value" I only get "PK".
Instead for an eml file I get this for example
"Received: from exc16tmpmr18.sede.corp.sanpaoloimi.com (10.49.75.7) by
And
...
PR85MB0251NAMP_--"
Can you give me support?

Thank you,
Daniel

4 REPLIES 4

harish.m
Level 12

Hi Daniel,

 

I dont recall I tried to convert xlsx file to text file.

If  you encountered the issue with conversion, I probably would suggest to convert in to csv and then to text file

https://community.blueprism.com/t5/Product-Forum/Converting-Excel-file-to-Csv-file/td-p/62584

----------------------- If I answered your query. Please mark it as the "Best Answer" [FirstName] [LastName] [Designation] [JobTitle] [City] [State] [Phone]

MichealCharron
Level 7

@dbellazzi 

Both the LoadTextFile function and the "Read All Text from File" actions are for reading files that are in a text format.

A ".xlsx" file is essentually a ZIP compressed file that contains all the data from the workbook. That is why you are getting a ZIP file signature of "PK" (Phil Katz the co-creator of the ZIP format) and all the compressed binary data put in the data item. The "Multiline Edit" dialog is encountering a control character that is cutting off the display of the data.

An EML file is always a text file that uses Base64 to store binary data within it so it would never encounter control characters.

 

Micheal Charron
RBC
Toronto, Ontario
Canada

Hi @MichealCharron,

That is very good info. Thanks for sharing.

----------------------- If I answered your query. Please mark it as the "Best Answer" [FirstName] [LastName] [Designation] [JobTitle] [City] [State] [Phone]

Daniel_Sanhueza
Level 8

Hello @dbellazzi 

What I have use in the past to "convert" an xlsx file into a txt file is the following secuence of steps;

  • MS Excel VBO:Create Instance
  • MS Excel VBO:Open Workbook
  • MS Excel VBO:Select (Give the range of the table, i.e. "A1;Z100")
  • MS Excel VBO:Copy
  • Utility - Environment: Get Clipboard or use a Calc stage with GetClipboard() function, save the data in a text dataitem.
  • Utility - File Management:Write text file (sending data item text that previously got the clipboard)
  • Utility - Environment:Clear Clipboard
  • MS Excel VBO:Close Instance

Not sure if this is the correct approach in your case but perhaps help you in some way.

Regards.

 

Daniel Sanhueza
RPA Professional Developer
Deloitte