Received: from mta2-rme.xtra.co.nz (mta2-rme.xtra.co.nz [203.96.92.3]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f46AL8A35150 for ; Sun, 6 May 2001 06:21:09 -0400 (EDT) (envelope-from csawtell@xtra.co.nz) Received: from berty ([210.55.121.57]) by mta2-rme.xtra.co.nz with SMTP id <20010506102110.QJRS2173058.mta2-rme.xtra.co.nz@berty>; Sun, 6 May 2001 22:21:10 +1200 Content-Type: Multipart/Mixed; charset="iso-8859-1"; boundary="------------Boundary-00=_STSWHTA9VRYL4B9AXF8D" From: Christopher Sawtell To: "Josh Berkus" , pgsql-sql@postgresql.org Subject: Re: Need help with search-and-replace Date: Sun, 6 May 2001 22:22:40 +1200 X-Mailer: KMail [version 1.2] References: In-Reply-To: MIME-Version: 1.0 Message-Id: <01050622224000.30303@berty> X-Archive-Number: 200105/37 X-Sequence-Number: 2838 --------------Boundary-00=_STSWHTA9VRYL4B9AXF8D Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit On Sunday 06 May 2001 10:27, Josh Berkus wrote: > Folks, > > I need to strip certain columns out of my pgdump file. However, I > can't figure out how to use any Unix-based tool to search-and-replace a > specific value which includes a tab character (e.g. replace "{TAB}7 > 00:00:00" with "" to eliminate the column). In other words you wish to remove one field from a tab delimited file? > RIght now, I'm copying the file to a Win32 machine and using MS Word > for the search-and-replace, Oh no! MS is bound to screw it up somehow. > but I'm sure there's got to be a better way > ... *without* learning VI or Emacs. Help man cut is your friend. info cut is another friend if you are on a GNU system. cat the.file | cut -f1,3- # assuming is the field you wish to remove is the second one. cut uses the tab character as the delimiter by default. single line file attached -- Sincerely etc., NAME Christopher Sawtell CELL PHONE 021 257 4451 ICQ UIN 45863470 EMAIL csawtell @ xtra . co . nz CNOTES ftp://ftp.funet.fi/pub/languages/C/tutorials/sawtell_C.tar.gz -->> Please refrain from using HTML or WORD attachments in e-mails to me <<-- --------------Boundary-00=_STSWHTA9VRYL4B9AXF8D Content-Type: text/plain; charset="iso-8859-1"; name="the.file" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="the.file" The first text field 700:00:00:00 the next field --------------Boundary-00=_STSWHTA9VRYL4B9AXF8D--