Re: OT: *nix text editor?

2002-02-12 Thread Thomas Spahni

On Mon, 4 Feb 2002, Matthew Walker wrote:

> I need to find a text editor for Linux that doesn’t load the whole file
> into memory. I need to edit a 1.5 gig text flatfile to add two lines.
> But I don’t have enough ram to open it in most programs. Can anyone
> recommend something?

  man sed

Rather obscure at the beginning but does the job.
(Filter: MySQL database table query)

Thomas Spahni


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: OT: *nix text editor?

2002-02-11 Thread Matthew Walker

Heh. I keep getting answers, after all this time. See below for how I
solved it.

Background:

I had a 1.5 gig flatfile, consisting of all the data from two databases.
I had neglected to put 'use ' lines in it, so I couldn't
simply load it back into MySQL. I had to add one line at the beginning,
and one line somewhere in the middle. Or so I thought. Here's what I
did.

Step 1: Use 'more' to find what line number the info for the second DB
started on.

Step 2: Use 'head' to grab the first n lines of the file, up to where
the second DB started, and pipe the output to a second file. I now have
the first DB in it's own file.

Step 3: Use 'tail' to grab the last n lines of the file, to get the
second DB. Also pipe this to a file. Now I have each DB in it's own
file.

Step 4: Upload each file on it's own into the server, telling the mysql
client what DB to send the data too.

Done. And all without adding any lines. Maybe this will help someone
else in the future who is in the same situation.

Matthew Walker
Ecommerce Project Manager
Mountain Top Herbs


-Original Message-
From: Thomas Spahni [mailto:[EMAIL PROTECTED]] 
Sent: Friday, February 08, 2002 5:25 AM
To: Matthew Walker
Cc: [EMAIL PROTECTED]
Subject: Re: OT: *nix text editor?

On Mon, 4 Feb 2002, Matthew Walker wrote:

> I need to find a text editor for Linux that doesn’t load the whole
file
> into memory. I need to edit a 1.5 gig text flatfile to add two lines.
> But I don’t have enough ram to open it in most programs. Can anyone
> recommend something?

  man sed

Rather obscure at the beginning but does the job.
(Filter: MySQL database table query)

Thomas Spahni


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.323 / Virus Database: 180 - Release Date: 2/8/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.323 / Virus Database: 180 - Release Date: 2/8/2002
 

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: OT: *nix text editor?

2002-02-08 Thread Thomas Spahni

On Mon, 4 Feb 2002, Matthew Walker wrote:

> I need to find a text editor for Linux that doesn’t load the whole file
> into memory. I need to edit a 1.5 gig text flatfile to add two lines.
> But I don’t have enough ram to open it in most programs. Can anyone
> recommend something?

  man sed

Rather obscure at the beginning but does the job.
(Filter: MySQL database table query)

Thomas Spahni


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: OT: *nix text editor?

2002-02-05 Thread harm

On Mon, Feb 04, 2002 at 08:01:39PM -0700, Matthew Walker wrote:
> I need to find a text editor for Linux that doesn?t load the whole file
> into memory. I need to edit a 1.5 gig text flatfile to add two lines.
> But I don?t have enough ram to open it in most programs. Can anyone
> recommend something?

echo 'select 1 from all; ' >> myfile.sql
echo 'select 2 from all; ' >> myfile.sql


is that editor enough? :)

(table etc)

-- 
   The Moon is Waning Crescent (41% of Full)
   nieuw.nl - 2dehands.nl: 15463

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: OT: *nix text editor?

2002-02-04 Thread Matthew Walker

I ended up using head and tail to split it into 2 files, so that I
didn't have to edit it. See, it was the output of a mysqldump from two
databases, and I needed to make sure each part went where it needed to
go.

Matthew Walker
Ecommerce Project Manager
Mountain Top Herbs


-Original Message-
From: Terrence W. Zellers [mailto:[EMAIL PROTECTED]] 
Sent: Monday, February 04, 2002 8:35 PM
To: Matthew Walker
Cc: [EMAIL PROTECTED]
Subject: Re: OT: *nix text editor?



On Mon, 4 Feb 2002, Matthew Walker wrote:

> I need to find a text editor for Linux that doesn’t load the whole
file
> into memory. I need to edit a 1.5 gig text flatfile to add two lines.
> But I don’t have enough ram to open it in most programs. Can anyone
> recommend something?

cat?

(No not being "wise" -->
   wc -l currentfile; #tells you number-of-lines
   vi/emacs newlinesfile;
   head -number-of-leading-lines currentfile > newfile;
   cat newlinesfile >> newfile;
   tail -(number-of-lines - number-of-leading-lines) currentfile >>
newfile;
)


+---
--+
| Copyright 2001 by Terrence W. Zellers.  All rights explicitly
reserved. |
| email: [EMAIL PROTECTED]
www.voicenet.com/~zellert/pub.key |
|---
--|
| A means of adding pith or humor to email: patent pending
|
+---
--+





---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.317 / Virus Database: 176 - Release Date: 1/21/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.317 / Virus Database: 176 - Release Date: 1/21/2002
 

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




OT: *nix text editor?

2002-02-04 Thread Matthew Walker

I need to find a text editor for Linux that doesn’t load the whole file
into memory. I need to edit a 1.5 gig text flatfile to add two lines.
But I don’t have enough ram to open it in most programs. Can anyone
recommend something?

Filter: sql,query

Matthew Walker
Ecommerce Project Manager
Mountain Top Herbs



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.317 / Virus Database: 176 - Release Date: 1/21/2002
 

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php