Insert date with GREP

2011-08-18 Thread Mark
Hi folks! Does anybody know if there's a way to enter today's date via search and replace? I have files with strings like this imported2009-02-12/imported and I'm processing them with a text factory that does a lot of other stuff. I would like it to also change the whatever date in that tag into

Re: Insert date with GREP

2011-08-18 Thread Roland Küffner
Hi, Mark Am 18.08.2011 um 10:23 schrieb Mark: Does anybody know if there's a way to enter today's date via search and replace? I have files with strings like this imported2009-02-12/imported and I'm processing them with a text factory that does a lot of other stuff. I would like it to also

Re: Insert date with GREP

2011-08-18 Thread Christopher Stone
On Aug 18, 2011, at 03:23, Mark wrote: Does anybody know if there's a way to enter today's date via search and replace? I have files with strings like this imported2009-02-12/imported and I'm processing them with a text factory

Re: Insert date with GREP

2011-08-18 Thread Doug McNutt
At 07:08 -0500 8/18/11, Christopher Stone wrote: On Aug 18, 2011, at 03:23, Mark wrote: Does anybody know if there's a way to enter today's date via search and replace? I have files with strings like this imported2009-02-12/imported and I'm processing them with a text factory Personally, I

Re: Insert date with GREP

2011-08-18 Thread John Delacour
At 10:23 +0200 18/08/2011, Mark wrote: Does anybody know if there's a way to enter today's date via search and replace? I have files with strings like this imported2009-02-12/imported and I'm processing them with a text factory that does a lot of other stuff. I would like it to also change

Re: Insert date with GREP

2011-08-18 Thread Ronald J Kimball
On Thu, Aug 18, 2011 at 08:43:05PM +0100, John Delacour wrote: #!/usr/local/bin/perl use strict; my @date = localtime; my @datearray; $date[5] += 1900; for (5,4,3) { push @datearray, sprintf '%.2d', $date[$_] } my $date = join -, @datearray; while () {

Re: Insert date with GREP

2011-08-18 Thread John Delacour
At 15:52 -0400 18/08/2011, Ronald J Kimball wrote: Although you add 1900 to the year, I think you forgot to add 1 to the month returned by localtime. Yep :-[ Here are two alternate ways to format today's date: my @date = localtime; my $date = sprintf %04d-%02d-%02d, $date[5] + 1900,