web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / I want to add double q...
Power Automate
Answered

I want to add double quotation to each item when writing CSV.

(0) ShareShare
ReportReport
Posted on by 12

Hi Community,

 

I want to add double quotation to each item when writing CSV.
I'm going to export the Query Result to CSV.
Is it possible with the Power Automate desktop?


ex)
aaa,bbb,ccc  -->  "aaa","bbb","ccc"

 

 

I have the same question (0)
  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Paste this into your workflow and have a look:

    SET Text TO $'''aaa,bbb,ccc'''
    Text.SplitText.SplitWithDelimiter Text: Text CustomDelimiter: $''',''' IsRegEx: False Result=> TextList
    LOOP i FROM 0 TO TextList.Count - 1 STEP 1
     SET TextList[i] TO $'''\"%TextList[i]%\"'''
    END
  • NAGARJ Profile Picture
    12 on at

    Thank you for your answer.

     

    My csv data has 4500 rows and 6 columns.
    The loop method is time consuming.

     

    I thought about using regular expressions as another method.

    SET Path TO $'''D:\\DataFolder\\DataFile_20220214.csv'''
    File.ReadTextFromFile.ReadText File: Path Encoding: File.TextFileEncoding.ANSI Content=> FileContents
    Text.Replace Text: FileContents TextToFind: $'''(.*?)(,|\\r?\\n|\\r)''' IsRegEx: True IgnoreCase: False ReplaceWith: $'''\"$1\"$2''' ActivateEscapeSequences: False Result=> Replaced
    File.WriteText File: $'''D:\\DataFolder\\DataFile_20220214.csv''' TextToWrite: FileContents AppendNewLine: True IfFileExists: File.IfFileExists.Overwrite Encoding: File.FileEncoding.ANSI

     

    The variable "Replaced" had double quotes.
    However, the actual csv file did not have double quotation.

     

    please help me.

     

    (I'm using the Japanese version.)

  • Verified answer
    NAGARJ Profile Picture
    12 on at

    This issue has been resolved in the following ways!

    SET Path TO $'''D:\\DataFolder\\DataFile_20220214.csv'''
    File.ReadTextFromFile.ReadText File: Path Encoding: File.TextFileEncoding.ANSI Content=> FileContents
    Text.AppendLine Text: FileContents LineToAppend: $'''''' Result=> Result
    Text.Replace Text: Result TextToFind: $'''(.*?)(,|\\r?\\n|\\r)''' IsRegEx: True IgnoreCase: False ReplaceWith: $'''\"$1\"$2''' ActivateEscapeSequences: False Result=> Replaced
    File.WriteText File: $'''D:\\DataFolder\\DataFile_20220214.csv''' TextToWrite: Replaced AppendNewLine: False IfFileExists: File.IfFileExists.Overwrite Encoding: File.FileEncoding.ANSI

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 474

#2
11manish Profile Picture

11manish 268

#3
David_MA Profile Picture

David_MA 243 Super User 2026 Season 1

Last 30 days Overall leaderboard