Extracting / Contain Match Time of Day

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Extracting / Contain Match Time of Day Tue Jan 25, 2022 10:56 am • by skerkvli
I am able to do a contain match to extract a date and change its format to be used in renaming a file but I have not found a way to extract time.

Here is an example of a line of text in a pdf file:
Date: January 24, 2022 at 1:29 AM

I can certainly do a 'contain match' on the AM and PM but those could possibly show up in the rest of the document, not just in the date line.

I could do something with a petter of Number:Number but it would take lots of conditions added to identify the following possibilities:

#:## AM
#:## PM
##:## AM
##:## PM

Because ##:## would also be matched with #:## I would have to account for that, putting a space in front of the 1st #?

Before I spend hours trying to come up with a solution I am hoping someone already has a solution!

Then when I have that solved, I also want to covert time to 24 hour time, such at 2:00 PM would be 1400.
The end result is to rename a file to look like this: 2022_01_24 1400.pdf
skerkvli
 
Posts: 2
Joined: Wed Feb 10, 2016 5:59 pm

Re: Extracting / Contain Match Time of Day Wed Jan 26, 2022 10:24 am • by Mr_Noodle
Are you using a custom text attribute for this? If so, you should be using a custom date attribute. It has an AM/PM token you can use.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Extracting / Contain Match Time of Day Wed Jan 26, 2022 10:58 am • by skerkvli
Thank you!

Within a few minutes of editing the rename with pattern entry to be the following, I was able to get exactly what I wanted.

1999-12-31 1330

The 13 setting formats it to 24 hour time.
skerkvli
 
Posts: 2
Joined: Wed Feb 10, 2016 5:59 pm


Return to Support