On 3/20/06, stu meacham <[EMAIL PROTECTED]> wrote: > > > perl -i -p -e 's/^(\d{2}\t\d{2}\t\d{2})/g' This was the 1st thing that I > > tried; it doesn't work. It was initially easy but different things kept > > appearing that forced me to use > 1 > statements on the command line. Negating what I want seems like it ought to > be simple.
There are a couple of things here: 1) s/// requires a string to replace the match with. you haven't supplied one. This should produce a syntax error. 2) You've anchored your patttern at the beginning of the string. This makes /g a no-op; you're pattern can't possibly match more than once, because '^' can only appear once. 3) s/// replaces whatever is matched on the left side with whatever you put on the right side, and leaves the rest of the string untouched. You need to specify what you don't want, as well. If you know that your will always have a single occurance at the beginning of the line, use something like: s/^(\d\d\t\d\d\t\d\d).*/$1/ I think we're about at the end of how much we can help based on what you've given us. Show us a couple of the complete command lines you've tried (so we can see what your ultimate goal is) and some sample data. -- jay -------------------------------------------------- This email and attachment(s): [ ] blogable; [ x ] ask first; [ ] private and confidential daggerquill [at] gmail [dot] com http://www.tuaw.com http://www.dpguru.com http://www.engatiki.org values of β will give rise to dom!