Skip to main content

Notifications

Community site session details

Community site session details

Session Id : y7uV+JsZBW2cAcvehbd/FS
Power Automate - General Discussion
Unanswered

Convert HTML file to txt or csv

Like (0) ShareShare
ReportReport
Posted on 5 Dec 2020 18:14:55 by 16

Hi Everyone,

 

Could you please help me with how to convert the HTML file created by SAP SM36 to a TXT or CSV file?

 

Erhan

  • Community Power Platform Member Profile Picture
    on 25 Apr 2023 at 02:44:27
    Re: Convert HTML file to txt or csv

    Hi bekkaye99,

    Have you been able to automate SAP reports in html towards converting them into excel or CSV file?

    Thanks for your guidance.

    Regards

     

  • nmk Profile Picture
    193 on 17 Dec 2020 at 06:10:23
    Re: Convert HTML file to txt or csv

    Hi,

    I have uploaded the flow under cookbook section

     

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/HTML-Table-to-CSV-or-Pipe-delimited-text...

     

    check this out and let me know if you this solves your problem.

     

    Please mark this post as 'Solution' if it resolves the problem.

  • bekkaye99 Profile Picture
    16 on 07 Dec 2020 at 18:46:20
    Re: Convert HTML file to txt or csv

    @nmkI asked the question to the SAP team and they could not support it so I try to find an alternative solution. For the time being, I can convert it with VBA but for it I need a computer to run the VBA code and send it to SharePoint which means not fully end-to-end workflow. I am not familiar with that you mentioned the solution but I will send a small real example to you.

  • bekkaye99 Profile Picture
    16 on 07 Dec 2020 at 18:37:26
    Re: Convert HTML file to txt or csv

    @Jay-Encodian from HTML to XLXS

  • nmk Profile Picture
    193 on 07 Dec 2020 at 15:58:03
    Re: Convert HTML file to txt or csv

    @bekkaye99 

     

    Well, you have the following options.

     

    1- Easy but not sure if possible

    -> Can you revert to the ppl who helped you create an html file from SAP and ask if there's a possiblity that they can create the file in a machine-friendly format? e.g. xml, json etc? Maybe they would be able to generate it in csv and you don't have to do anything :)- I am really not sure about the capability there but I think ABAP language should have this feature


    2-> Parse the HTML file contents in a power automate flow and convert it csv. This is surely possible but a tedious and inefficient process. How big is your actual file which you are going to process? how many records? You basically need to apply various string functions to get the data out of html, create a json array and use create csv table action. If you provide the sample html record in text format, then I can show you a real example.


    There are other options like create your own connectors or just do it outside power automate... an example would be via using js library https://github.com/linways/table-to-excel js library.

  • Jay-Encodian Profile Picture
    2,920 on 07 Dec 2020 at 15:24:33
    Re: Convert HTML file to txt or csv

    @bekkaye99 What format are you trying to convert the XLSX to?

  • bekkaye99 Profile Picture
    16 on 07 Dec 2020 at 15:22:00
    Re: Convert HTML file to txt or csv

    Actually, I want to convert to XLSX via MS Flow to work with it very comfortably but as far as I know, there is no solution for it. Actually using VBA and MS Excel I can convert it very easily but MS Excel online does not support VBA, therefore, I am trying to convert HTML to TXT, CSV for an end-to-end workflow.

  • Jay-Encodian Profile Picture
    2,920 on 07 Dec 2020 at 14:20:19
    Re: Convert HTML file to txt or csv

    @bekkaye99 

    If you want a visual representation of HTML in another format, TXT is not really a viable format, perhaps PDF? .The TXT file is showing the HTML source as the HTML file... a browser interprets HTML source to render a visual.

  • bekkaye99 Profile Picture
    16 on 07 Dec 2020 at 13:44:59
    Re: Convert HTML file to txt or csv

    Hi @Jay-Encodian 

     

    See the same usable format as below

     

    Raw html datat2.png

    After MS flow data

    t3.png,

  • nmk Profile Picture
    193 on 07 Dec 2020 at 13:41:56
    Re: Convert HTML file to txt or csv

    As per my understanding, he's trying to save the rendered output as a text file. 

    Can you please share a sample file with us?

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,089 Most Valuable Professional

Leaderboard
Loading started