Parsing a text file for information

William Park opengeometry at yahoo.ca
Sat May 18 23:25:03 EDT 2002


On Sun, May 19, 2002 at 12:52:06AM +0000, Colin Meeks wrote:
> I have a text file that is several magabytes in size and would like to
> strip it of certain information. The information I want is always
> preceeded by
>     GETTEXT=
> and is in itself 18 characters long.  Is there a regular expression I
> could use to simplify the task.

Try playing with
    grep 'GETTEXT=' file | cut -f 2 -d '='
    grep 'GETTEXT=' file | sed 's/GETTEXT=//'

Can't be more specific without more detail...

-- 
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
8-CPU Cluster, Hosting, NAS, Linux, LaTeX, python, vim, mutt, tin





More information about the Python-list mailing list