cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bhanney2323
Resolver I
Resolver I

Create Tab deiminated Txt file from create csv table

Hi, so I'm having trouble outputting this text file in the correct format. I need to convert my csv table output into a text file that is tab delimited. When I convert it to a text file it has commas in it, which is not what I want.

 

The pictures below should explain Current Create a CSV file FLOW

bhanney2323_0-1607087757587.png

Current Output:

bhanney2323_1-1607087806293.png

 

Example Output that I want

bhanney2323_2-1607087878023.png

They aren't the same fields but its basically tabs between each column

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

Yes, you could do this:

  1. Replace the commas in the data with some other symbol. Lets say the Carat Symbol ^
  2. Create the CSV
  3. Replace the commas with tabs
  4. Replace the carats with commas to restore the data back to its original form.

Example:

ReplaceCommaWithTab.png

 

View solution in original post

4 REPLIES 4
Paulie78
Super User
Super User

You could try this:

ReplaceCommaWithTab.png

Expression is:

replace(body('Create_CSV_table'), ',', decodeBase64('CQ=='))

Word of caution though, if your data contains commas, then they will be replaced with tabs.

This would work for the majority of the files that I have to output; however, yes some of them do contain commas, do you think there is any way around this? 

Paulie78
Super User
Super User

Yes, you could do this:

  1. Replace the commas in the data with some other symbol. Lets say the Carat Symbol ^
  2. Create the CSV
  3. Replace the commas with tabs
  4. Replace the carats with commas to restore the data back to its original form.

Example:

ReplaceCommaWithTab.png

 

Hey @bhanney2323 

 

This worked super fine. Could you please let me know what 'CQ==' does? I applied your logic and the text file came out good. However, I have another request on expanding the spaces between columns/values. 

 

Current Output:

Column1  Column2  Column3

    ABC.        123           DEF

    ABC.        123           DEF

 

Expected Output

Column1               Column2                 Column3

    ABC.                      123                          DEF

    ABC.                      123                          DEF

 

I tried replace(XXXXXX, ',' ,'     ') but the output looks weird.

 

Column1            Column2             Column3

    ABC.                   123                      DEF

    ABC.                      123                          DEF

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (4,259)