Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I need to extract the filename and date of modification from prints that I receive.
Is it possbile on to put that info in a table?
I did it manually, but query gets broken when anything there changes.
They look like this:
D:\Temp>dir
Volume in drive D is HDDX
Volume Serial Number is XXXX-XXXX
Directory of D:\Temp
02/28/2021 08:23 PM <DIR> .
02/28/2021 08:23 PM <DIR> ..
02/28/2021 08:22 PM 193 assistant_installer_20210228202253.log
02/28/2021 08:20 PM 0 file1 - Copy (2).txt
02/28/2021 08:20 PM 0 file1 - Copy (3).txt
02/28/2021 08:20 PM 0 file1 - Copy (4).txt
02/28/2021 08:20 PM 0 file1 - Copy (5).txt
02/28/2021 08:20 PM 0 file1 - Copy (6).txt
02/28/2021 08:20 PM 0 file1 - Copy (7).txt
02/28/2021 08:20 PM 0 file1 - Copy (8).txt
02/28/2021 08:20 PM 0 file1 - Copy (9).txt
02/28/2021 08:20 PM 0 file1.txt
02/28/2021 08:20 PM 0 file2.txt
02/28/2021 06:40 PM 0 FXSAPIDebugLogFile.txt
02/28/2021 06:40 PM 50,216 ThrottleStop.sys
13 File(s) 50,409 bytes
2 Dir(s) 225,865,232,384 bytes free
Hi @creyssonbr
You can use Web.Page to wrap regex, however, I don't know how to extract MM/DD/YYY HH:MM AM/PM. Below one is not working...just show Web.Page, you can add a custom column
[ fx=(e as text) =>Web.Page(
"<script>
var regex = /^\d{2}/\d{2}/\d{4}\s+\d{2}:\d{2}\s+(AM|PM)$/;
document.write('"&e&"'.match(regex));
</script>")[Data]{0}[Children]{0}[Children]{1}[Text]{0},
b = fx( [your Column])][b]
If your print in text is all structured, use below ones?
Table.AddColumn(Source, "Custom", each Text.Start([Column1],20)
Table.AddColumn(#"Added Custom", "Custom1", each Text.Middle([Column1],20))
@creyssonbr You should be able to use a folder query, that will get a list of source files in the directory. Not sure about the last modificiation date.
Thanks for your reply @Greg_Deckler .
I would but I don't have access to that folder.
I only receive a print in txt.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
53 | |
21 | |
13 | |
11 |