Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f47DHqA74928 for ; Mon, 7 May 2001 09:17:52 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f45NQcA26160 for ; Sat, 5 May 2001 19:26:38 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f45NOtu79737 for pgsql-sql@postgresql.org; Sat, 5 May 2001 19:24:55 -0400 (EDT) (envelope-from news) From: Ian Harding X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Need help with search-and-replace Date: Sat, 05 May 2001 16:33:04 -0700 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 40 Message-ID: <3AF48DB0.295E04FF@pakrat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.12-20 i686) X-Accept-Language: en To: pgsql-sql@postgresql.org X-Archive-Number: 200105/44 X-Sequence-Number: 2845 There are oh-so-many ways, as I am sure people will tell you. regular expressions are the most wonderful things for such a task. I am comfortable with tcl, so I would read the file into a tcl variable and use 'regsub -all {\t700:00:00} $instring {} outstring'. There are unbelievably simple, unvbelievably fast ways to do this in one line from the shell using sed, but I don't speak sed. I suspect someone will hook you up with some basic sed. Try this in Windows. Visual Basic can use regular expressions, but you have to instantiate a regular expression object, then execute one of it's methods to do anything. Ugh. Ian 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). > > RIght now, I'm copying the file to a Win32 machine and using MS Word > for the search-and-replace, but I'm sure there's got to be a better way > ... *without* learning VI or Emacs. Help? > > -Josh > > ______AGLIO DATABASE SOLUTIONS___________________________ > Josh Berkus > Complete information technology josh@agliodbs.com > and data management solutions (415) 565-7293 > for law firms, small businesses fax 621-2533 > and non-profit organizations. San Francisco > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster