Timeline for Powershell: How do I shift a date (format: yyyymmdd) from any position in the file name to end of the file name?
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 26, 2022 at 13:00 | answer | added | Theo | timeline score: 0 | |
Jan 23, 2022 at 1:16 | comment | added | Lee_Dailey | @schwadinho - thank you for the added info. [grin] ///// now ... do you really want to combine those 3 input file names into one file name? if not ... please show what you want each to end up with. exactly what you want each of those demo file names to become. | |
Jan 22, 2022 at 22:04 | answer | added | Reddy Lutonadio | timeline score: 0 | |
Jan 22, 2022 at 20:26 | comment | added | SimonS |
if you use $_.name -match '(19|20\d{2})(\d{2})(\d{2})' or another regex of your choice - you will have the complete date in $Matches[0] and you can put it wherever you want
|
|
Jan 22, 2022 at 20:08 | comment | added | schwadinho | I added some sample file names. Thanks for your help! :) | |
Jan 22, 2022 at 20:08 | history | edited | schwadinho | CC BY-SA 4.0 |
added 251 characters in body
|
Jan 22, 2022 at 11:05 | review | Close votes | |||
Feb 6, 2022 at 3:07 | |||||
Jan 21, 2022 at 19:16 | comment | added | Lee_Dailey | please add a few sample file names to your Question for folks to work with. concrete is easier to tinker with than abstract. [grin] | |
Jan 21, 2022 at 18:09 | comment | added | Frank Thomas | Id usually use a regular expression with 3 capture groups; everything before the date, the date, and everything after the date. then I'd use an replace expression like $0$2$1 to combine what is before and after the date, and drop the date at the end. | |
S Jan 21, 2022 at 17:44 | review | First questions | |||
Jan 21, 2022 at 17:51 | |||||
S Jan 21, 2022 at 17:44 | history | asked | schwadinho | CC BY-SA 4.0 |