I would like to rename a group of files that can be repeated within the file name. To remove everything from the "dot + space" pattern at the beginning Ex: "wxxdv xcvxcv .sdfsdf .sd.txt" to create "sdfsdf.sd.txt" ("wxxdv xcvxcv."), Which removes the first occurrence of I found that the following commands are not too far from my goal (but does not work): Bonus question, Thanks, it is an attempt to use my first powers "dot + space" = "." ) East: "Rand M., Bilu.
Arrival 1901.txt " "
Arrival 1901.txt " ( Delete "should be M. , Bilu. ")
dir * .txt | Mean-Dest {($ _ Basename -replace '^ [AG] + \.' S ',' '). Trim () + $ _ Extension}
$ t = "round m, bill. Arrival 1901.txt" $ formatedText = $ t.Substring (([regex] :: split ($ t , '\. \ S') [0]). Length + 2) write-host $ formatedText arrival 1901.txt
No comments:
Post a Comment