January 6, 2005
3:00 PM
Subscribe
I'm using Grep within BBedit 6.1.2 lite, in order to change some data in tables from "regular" time in the format: "0530PM" to military time: "1730"
Essentially, I am able to locate the data I want using:
(####)PM
Which, in the above example returns: "0530"
So here's the question: I want to treat that result as a number, and add 1200 to it to convert it to military time.
Is there a way to do this within BBedit using the replacement patterns, or do I have to go figure out how to write a perl/python/awk/applescript to accomplish this?
posted by mecran01 to (10 comments total)
you could do 12 separate replaces on your set of files, along the lines of:
replace: (05)(\d\d)PM
with: 17\2
replace: (01)(\d\d)PM
with: 13\2
etc. (my bbedit seems to like \d instead of #, but same idea)
personally I would use perl or applescript+bbedit if it's more than just a one-time thing.
posted by dorian at 3:18 PM on January 6, 2005