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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / read from CSV file issue
Power Automate
Unanswered

read from CSV file issue

(0) ShareShare
ReportReport
Posted on by

Hi Everybody,

I'm trying convent the txt file with separator "fixed column widths", but that have error message when i run the flow, please help and thank you in advance.

 

Error message:

Import failed. Error while parsing

Error details.

Line 10 cannot be parsed using the current FieldWidths.: Robin.Core.ActionException: Import failed. Error while parsing ---> Microsoft.VisualBasic.FileIO.MalformedLineException: Line 10 cannot be parsed using the current FieldWidths.
at Microsoft.VisualBasic.FileIO.TextFieldParser.ValidateFixedWidthLine(StringInfo Line, Int64 LineNumber)
at Microsoft.VisualBasic.FileIO.TextFieldParser.ParseFixedWidthLine()
at Microsoft.VisualBasic.FileIO.TextFieldParser.ReadFields()
at Robin.Modules.File.Actions.FileActions.ReadFieldsEnhanced(TextFieldParser parser)
at Robin.Modules.File.Actions.FileActions.ImportCSVResource(Variant csvFilepath, Variant rawCsvText, Variant customColumnsSeparator, Variant fixedColumnWidths, Variant& csvTable, Int32 csvSourceMode, Int32 csvFileEncoding, Int32 separatorType, Boolean trimFields, Boolean firstLineContainsColumnsNames)
--- End of inner exception stack trace ---
at Robin.Modules.File.Actions.ReadFromCSVFile.Execute(ActionContext context)
at Robin.Runtime.Engine.ActionRunner.RunAction(String action, Dictionary`2 inputArguments, Dictionary`2 outputArguments, IActionStatement statement)

 

 

KamenKam_0-1692174734663.png

 

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Does your file have 10 lines? Perhaps there's a newline at the end with a blank line that makes it fail? 

    If so, you can try using Read text from file to get the file contents as a single blob of text. Then use Trim text to trim it and then use Write text to file to write it back as a plain text.

     

    Once you've done this pre-processing, you can try reading it as a CSV file with fixed column lengths again.

    -------------------------------------------------------------------------

    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard