We have a department that gets information from a 3rd party that sends the data over as a Fixed Width Text file.
We are trying to use Power Automate to take the Rows of data, then break out the data for each row to write back to Excel columns.
The issue we are finding is that the Fixed Width is not always the same and so when we try to add the data to the Excel file, data is either missing, or getting added to the wrong columns.
We've created an Array Variable from the file content:
We then used a compose to split the Text out for each row using the expression - split(outputs('Compose_2'),' ')
But having a heck of a time, due to the Data not always being in the same spot, to add the data to the Excel file in the correct columns.
I've attached the Test Text file, as well as the Output we get back from the Split expression.
Thanks in advance with any help you can give us.
Thank you, this is GREAT!!
The department gets about 10 different formatted Fixed Width Text files from the 3rd party.
So this code will work for all and the data we have back can then be added to the Excel file!
thanks again!!!
I started from the arrangement of lines of text:
My flow:
My flow detail:
trim(item())
I hope it helps you
Greetings!
Hoping someone might have a "cleaner" way of doing this.. Below is part of what we have so far( there are a total of 19 composes) that seems to be working.
If anyone has any ideas on how to simplify this, I'd be glad to hear it..
We tried to use Parse Json, but it does NOT like fixed width text files, so this is what we cam up with.