Forum Discussion
juan jimenez
Sep 12, 2023Iron Contributor
Power query with txt for messages
hi, I would like to import the messages from conversations that I receive in txt format via Power Query. I have uploaded the "txt" here as a "docx" because this platform does not accept txt files...
- Sep 14, 2023
That didn't work since dates were converted using US locale. With UK locale it work, please see attached. You may change in Change Type with Locale step.
SergeiBaklan
Sep 15, 2023Diamond Contributor
juan jimenez It looks like works since post is accepted. Good luck!
juan jimenez
Sep 17, 2023Iron Contributor
Hello Sergei,
I apologize for insisting on this matter. I've tried importing these sentences, and I noticed that
1) not all the complete texts of the conversations appear, and
2) the order in which they were written has changed.
Could you please take a look at the attached PQ (https://1drv.ms/x/s!AlPgnUYDBAuukh9cF_02HLdlxqmr?e=fgrGGC)
and the txt in this link (https://1drv.ms/t/s!AlPgnUYDBAuukh7twVQBAt4qXE8L?e=KDCsjp)?
Thank you very much, Juan.
I apologize for insisting on this matter. I've tried importing these sentences, and I noticed that
1) not all the complete texts of the conversations appear, and
2) the order in which they were written has changed.
Could you please take a look at the attached PQ (https://1drv.ms/x/s!AlPgnUYDBAuukh9cF_02HLdlxqmr?e=fgrGGC)
and the txt in this link (https://1drv.ms/t/s!AlPgnUYDBAuukh7twVQBAt4qXE8L?e=KDCsjp)?
Thank you very much, Juan.
- SergeiBaklanSep 24, 2023Diamond Contributor
- juan jimenezSep 24, 2023Iron ContributorDear Sergei,
your PQ was working perfectly until a new txt came and a problem arised. Would you mind telling me problem and even correcting the attached coding?
https://1drv.ms/f/s!AlPgnUYDBAuukjaxyOz8oGFm60vd?e=jehfft - SergeiBaklanSep 18, 2023Diamond Contributor
Hi Juan,
I see, that's since we have quotes within the text. Please check "Chat con XXX updated" query in attached.
On third step I used
= Table.AddColumn(FilteredFiles, "Data", each Table.FromColumns({Lines.FromBinary([Content], null, null, 65001)}))instead of csv importing.
On intermediate steps where we split columns QuoteStyle.Csv was changed on QuoteStyle.None.
As for the sorting I kept initial index, on final step sorting is by date, time and Id.
Then you add another file please be sure it has exactly the same structure and applied data types.