I agree with Chip and have a recommendation. Since you have been
using Vim, Perl will be much easier to learn.
When I first began studying programming Perl was over my head and
seemed very difficult.
I found it incredibly easy to learn Perl. I was faced with a large
data-reformatting
On Fri, 4 Aug 2006 09:07:35 -0400, striker [EMAIL PROTECTED] wrote:
I agree with Chip and have a recommendation. Since you have been
using Vim, Perl will be much easier to learn.
A very good beginning book on Perl is located at http://
learn.perl.org/library/beginning_perl/ . It is not
Chip, your solution worked beautifully. It didn't expand all of the
years to four digits, but the new database app will take care of that.
I really appreciate the help.
Best wishes,
Marv
On 8/3/06, Charles E Campbell Jr [EMAIL PROTECTED] wrote:
Marv Boyes wrote:
For example, let's say I
Actually, I'm a Linux guy; just trapped behind Windows at work (though
VMWare Player and an Ubuntu image get me through).
I would have loved to have used Perl, if I had the faintest notion
how. When it comes to programming, I never mad it beyond
intermediate bash scripting, and enough Python to
I agree with Chip and have a recommendation. Since you have been
using Vim, Perl will be much easier to learn.
A very good beginning book on Perl is located at http://
learn.perl.org/library/beginning_perl/ . It is not as
thorough as the 'Camel' book, but has a lot of good info. and the
Marv Boyes wrote:
Actually, I'm a Linux guy; just trapped behind Windows at work (though
VMWare Player and an Ubuntu image get me through).
I would have loved to have used Perl, if I had the faintest notion
how. When it comes to programming, I never mad it beyond
intermediate bash scripting,
Hello, all. I've been tasked with migrating a large MS Works
database into the 21st century. The thing's original setup didn't
enforce any sort of standardization in data entry, so there are nearly
as many different formats and styles in the data as there have been
people entering it. My best bet
Hi,
Marv Boyes wrote:
Hello, all. I've been tasked with migrating a large MS Works
database into the 21st century. The thing's original setup didn't
enforce any sort of standardization in data entry, so there are nearly
as many different formats and styles in the data as there have been
I can't seem ot get the hang of it for this particular job.
Well, even as a regexp wonk, it's a bit of a daunting task you
have before you. :)
Most of
the problem is with dates, in that I have a mishmash of formats.
Since you don't mention any other problematic sections, I guess
I'll
part of a good job is to choose the right tool.
use perl for this kind of task. use vim to edit the perl script ;-) and
search cpan before creating your own solutions!
/martin
begin:vcard
fn:Martin Kraegeloh
n:Kraegeloh;Martin
adr:;;Am Alten Pfarrhof 24;Oberbergkirchen;;84564;Germany
Tim Chase wrote:
[...]
I broke it out into multiple lines to hopefully make more sense of it.
The first two substitute() lines add a zero on the left of whatever they
found, and then take whatever the rightmost two characters of the result
are...effectively padding them with zeros on the left
Marv Boyes wrote:
For example, let's say I have some dates that look like this:
7-30-05
12-5-2006
10-2-06
What I'd like to end up with is this...
07/30/2005
12/05/2006
10/02/2006
...without, of course, having to re-type every single one
martin kraegeloh wrote:
part of a good job is to choose the right tool.
use perl for this kind of task. use vim to edit the perl script ;-)
and search cpan before creating your own solutions!
Two problems with this approach:
* Perl's regular expressions don't appear to be much more
right('0'.submatch(1), 2)
to zero-pad to 2 places. Alas, the substitute() trick is the easiest
way I've found to simulate this.
[...]
(0 . submatch(1))[-2:]
Hmmm...a nifty new feature in vim7 that is here on my work
machine, but unavailable on my hosting service (still running
Tim Chase wrote:
right('0'.submatch(1), 2)
to zero-pad to 2 places. Alas, the substitute() trick is the easiest
way I've found to simulate this.
[...]
(0 . submatch(1))[-2:]
Hmmm...a nifty new feature in vim7 that is here on my work machine, but
unavailable on my hosting service
(0 . submatch(1))[-2:]
Hmmm...a nifty new feature in vim7 that is here on my work machine, but
unavailable on my hosting service (still running 6.3). Looks like a
much-needed pilfering from Python's handy slicing syntax. :)
well, then,
strpart(0 . submatch(1), strlen(submatch(1)) -
On Thu 3-Aug-06 9:49am -0600, Jürgen Krämer wrote:
snipped
Very nice explanation! Two minor cosmetic improvements are
(1) to use Vim's line continuation to break up that very
long line and (2) making the regex very magic (your use of
comma eliminated 2 escapes, \v eliminates another 13
escapes.
For example, let's say I have some dates that look like this:
7-30-05
12-5-2006
10-2-06
What I'd like to end up with is this...
07/30/2005
12/05/2006
10/02/2006
Sorry this is a bit off topic:
I just wanted to add that ms excel, or
18 matches
Mail list logo