Hi Steve,
It would be helpful if you would be a bit more specific about what you're
trying to do. I'm having trouble interpreting your question.
Do you mean to:
* delete entire lines if they contain "8,000.00" or "9,000.00" anywhere
egrep -v '[89],000\.00' infile >outfile
* delete entire lines if they contain, anywhere, strings of prices with
digits and commas and ending with "." followed by two digits
egrep -v '[0-9]+,[0-9]+\.[0-9][0-9]' infile >outfile
* same as above, but delete only if those things are the *ONLY* things
on the line.
egrep -v '^[0-9]+,[0-9]+\.[0-9][0-9]$' infile >outfile
* delete the commas from all strings of form
<digits>,<digits>.<digit><digit>
sed 's/\([0-9][0-9]*\),\([0-9][0-9]*\)\.\([0-9][0-9]\)/\1\2.\3/' infile >outfile
(you have to make this a little fancier if you have bigger numbers
like 123,456,789.12)
It would be nicer with perl instead of sed since perl understands
"+" in regular expressions whereas some sed versions don't. Perl
also has, in general, much more powerful regular-expressions.
Or do you mean something else entirely?
pete peterson
GenRad, Inc.
7 Technology Park Drive
Westford, MA 01886-0033
[EMAIL PROTECTED] or [EMAIL PROTECTED]
+1-978-589-7478 (GenRad); +1-978-256-5829 (Home: Chelmsford, MA)
+1-978-589-2088 (Closest FAX); +1-978-589-7007 (Main GenRad FAX)
> Date: Thu, 9 Mar 2000 23:52:29 -0800 (PST)
> From: Steve Lee <[EMAIL PROTECTED]>
> To: RedHat Maillist <[EMAIL PROTECTED]>
> Subject: script
>
> can someone help me write
> a script to remove , out of a file
> lines of data with price that has
>
> 9,000.00
> 8,000.00
>
>
> etc
>
> about 710 line of these with text too.
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.