[RLUG] Re: quick question
Bill Cunningham
axoibc at yahoo.com
Thu Jun 29 20:23:06 PDT 2006
I know the original question was to truncate the first 300 lines of the file but why do that when you could just solve the problem without modifying the original file at all. If the purpose is to not send the first 300 bytes to a command then simply use the tail command:
tail -300 original_file
So if you wanted to feed the original file to mysql you could use:
mysql < tail -300 original_file
( I'm a little rusty so man tail to find the exact command.) I'm of the belief of keep it simple. Why modify the file at all?
Bill Cunningham
----- Original Message ----
From: P_Thorne <p_thorne at sbcglobal.net>
To: rlug at rlug.org
Sent: Thursday, June 29, 2006 7:08:39 PM
Subject: [RLUG] Re: quick question
This idea wouldn't satisfy the original premise of the thread that the
file couldn't exist twice:
Has anyone thought of using the shell command "split"? I have used
split or csplit to vi edit small portions of very large ascii files,
recombining the big file using "cat". It would probably not have been
any faster than using "sed" as the original author did, but you might be
able to do more complex editing.
_______________________________________________
RLUG mailing list
RLUG at rlug.org
http://lists.rlug.org/mailman/listinfo/rlug
More information about the RLUG
mailing list