Quantcast
Channel: CodeProject Latest postings for Regular Expressions
Viewing all articles
Browse latest Browse all 224

06h36m03s to 06h36.1, etc., in filename via regex?

$
0
0
Hello, and hoping this isn't too difficult, as I know once we get the regex, these things work beautifully. I'm not even a novice, I can never figure these complex ones out. But here's the deal.

I have a capture program that captures with timestamp and a filename, which is great. Here is the format they come out as, as an example:

2022.01.30.Sun, 06h36m03s- filename 1.png
2022.01.30.Sun, 06h36m10s- filename 2.png
2022.01.30.Sun, 06h36m16s- filename 3.png
2022.01.30.Sun, 06h36m22s- filename 4.png

The change that is needed is for the timestamp portion above, to be changed from this:

06h36m03s
06h36m10s

to this, if under 9 files:

06h36.1
06h36.2

or to this is over 9 files:

06h36.01
06h36.02
06h36.03
06h36.04
06h36.05
06h36.06
06h36.07
06h36.08
06h36.09
06h36.10
06h36.11

So removined the seconds and just putting in a ".1" or ".01", etc., as needed.

I used to just go to my renamer's forum but it's been dead quite a while now. Hoping someone here can kindly help out.

Thank you in advance!

Viewing all articles
Browse latest Browse all 224

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>