cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

Convert xlsx to text file

Is there a way to convert my xlsx file to a text file?

 

Or perhaps there's another way to do what I'm trying to achieve.

 

I have a PDF with fillable fields.  I have a SharePoint List with data.  I want to fill the PDF with the SP list data.

 

Where I'm at right now:
Right now the "Subject" line is what I'm attempting to do because I want to use the "Import Data" feature in Acrobat, using a .txt Text File (Tab-Delimited) file.  I have a flow that already takes a template .xlsx of the tab-delimited data from my PDF, and my flow gets the SP List data and inputs it into a row in the table of the xlsx file.

 

If I do the next part manually, which is to open the xlsx file and Save As .txt Tab-Delimited file, it works flawlessly when using it to "Import Data" in Acrobat.  I want flow to do this part though.  I'm happy with having to do the "Import Data" part manually, I'd just like to be able to eliminate opening the excel file and doing the Save As (but if there's a way to also automate the "Import Data" part, that would be great too).

10 REPLIES 10
Highlighted
Super User
Super User

Re: Convert xlsx to text file

Hi @seraph787,

 

Try the following.

Flow Step 1 - Get file content using path
> File Path - Here set your excel sheet path and name
> Infer Content Type - Set this to yes

 

Flow Step 2 - Create file
> Folder path - Set the path
> Filename - Set filename
> File Content - Set filecontent from previous step

 

I haven't personally tried this. Let me know if this works or not.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Advocate II
Advocate II

Re: Convert xlsx to text file

Following those steps produced an unreadable .txt file (containing gibberish like "k�7���ګHE^E(�*[a=d") from flow step 2.  

 

I checked to see what the output was for Flow Step 1:

{
"$content-type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"$content": "UEsDBBQAB....<pages and pages of gibberish>...gAIAAAAIQA/jEuNaw"
}
 
I did set flow step 1 to the xlsx file and Yes to 'infer content type'
The name of the file in step 2: test2.txt with the content being the output from step 1.
 
Highlighted
Advocate II
Advocate II

Re: Convert xlsx to text file

Anyone have any ideas on this?

Highlighted
Super User
Super User

Re: Convert xlsx to text file

Hi @seraph787,

 

Why not create the CSV file directly from SharePoint list using flow?

 

If not try the following flow action steps:

 

Get Rows (Excel)

Apply to each

Append the values to string

Create File

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Highlighted
Advocate II
Advocate II

Re: Convert xlsx to text file

That's one of the things I previously tried because I wanted to export the tab-delimited text portion.  The issue is that the CSV came out wrong.  The delimiters were correct for the 2nd row (tabs) but the first row was delimited by dashes, which put the entire header row in the first field of that row.

 

Below is an example of what I got:

Header1-Header2-Header3

Content1<tab>Content2<tab>Content3<tab>

 

Even if I somehow get it to stop putting dashes in the header row, I still have to open up Excel just as I currently have to do with the xlsx file.  Having an xlsx file is no different from having a csv file.  I'm trying to eliminate the need to open excel (to Save As tab-delimited txt file) before I open up the PDF to import the data.

 

Truly, I thought this would not be too complex for Flow to convert a file to a tab-delimited one.

I double-checked the possible file types allowed by Acrobat's "Import Data" feature; they are:

  • *.fdf
  • *.xfdf
  • *.xml
  • *.xfd
  • *.txt

Maybe we might have better luck with one of the other options?

Highlighted
Super User
Super User

Re: Convert xlsx to text file

Hi @seraph787 

To confirm your requiement is: 

I have a PDF with fillable fields.  I have a SharePoint List with data.  I want to fill the PDF with the SP list data.

This is a very rudimentary approach but you could simply watermark the SharePoint list data directly onto the PDF form? and then OCR the output.

 

Highlighted
Super User
Super User

Re: Convert xlsx to text file

Hi @seraph787 

To confirm your requiement is: 

I have a PDF with fillable fields.  I have a SharePoint List with data.  I want to fill the PDF with the SP list data.

This is a very rudimentary approach but you could simply watermark the SharePoint list data directly onto the PDF form? and then OCR the output.

Highlighted
Advocate II
Advocate II

Re: Convert xlsx to text file

Hi @Jay-Encodian ,

 

Almost. The exact requirement is:


I have a PDF with fillable fields.  I have a SharePoint List with data.  I want to fill the PDF with SP list data.  The PDF fillable fields must remain fillable.

 

This is because I need to pre-fill the form but still allow the user to modify their inputs.

Highlighted
Super User
Super User

Re: Convert xlsx to text file

Hi @seraph787 

This is a tricky one! I don't think there is an Microsoft or 3rd party action(s) which will fulfill all your requirements.

Encodian provide a 'Word to PDF Form' action, but your left with the challenge of creating the word document with controls whcih are dynamically set based on SharePoint list data. 

We have done something very similar before... but this solution required custom C# code... we created an Azure function which programmtically converted a docx file into a PDF form, creating and dynamically setting the PDF form fields (including default values) from a few different sources. We then called the Azure function via a web request within Flow. 

Outside of custom code, I'm not sure this can be done as you need to access existing PDF form fields and change the data.... others of course may know of another way.

HTH Jay

 

Highlighted
New Member

Re: Convert xlsx to text file

Total CSV Converter is a tool developed by CoolUtils. It is a reliable tool for converting CSV, TSV or any files with an extension .txt or .doc. You can also do the conversion using the command line. It supports multiple extension like HTML, JSON, XLS, XLSX etc

 

You can read more about it here - https://www.coolutils.com/TotalCSVConverter

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (10,666)