Sep 12 2023 03:28 AM
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!!.
Unfortunately, there are errors because sometimes the message lines are cut in 2 lines, and the cut part is considered an error.
1. Is there a way to concatenate the messages so that the cut phrases are not lost?
2. Could someone continue the code so that new files placed in the source folder are added to the spreadsheet without deleting the previous ones?
Thank you very much, Juan
Sep 12 2023 08:54 AM
1) Could you please clarify what is desired result for such blocks (if source is recognized correctly)
Where marked texts shall be or they shall be removed?
2) If you use From Folder connections files are appended, nothing is removed.
Sep 12 2023 09:15 AM
Sep 12 2023 09:42 AM
Okay, but it's better to know how above texts are separated in csv. Is that crlf, or lf or what. If you can't share .txt here perhaps you could share the source on OneDrive or like and share the link make it available for everyone.
Sep 12 2023 10:07 AM
Sep 13 2023 05:20 AM
Please find query in attached file. in Source step change file path on your one. Result is
Sep 14 2023 10:21 AM
Sep 14 2023 11:53 AM
SolutionThat 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.
Sep 15 2023 04:58 AM
@juan jimenez It looks like works since post is accepted. Good luck!
Sep 17 2023 10:27 AM
Sep 18 2023 02:50 AM
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.
Sep 24 2023 03:16 AM
Sep 24 2023 08:32 AM - edited Sep 24 2023 08:32 AM
Sep 14 2023 11:53 AM
SolutionThat 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.