All points that were going to Bill will be redirected to you, Jeff ;)
Here you go:
+31.76 points
Don't spend them all in one place ;) Great solution BTW.
- Sebastian
On Fri, 30 Jun 2006, Jeff Shippen wrote:
heh, you guys are acting like you never got the e-mail i sent days ago
regarding the tail command.
tail +301 bigfile will start at line 301 and display till the end, you can
then use redirection to put it in a new file. So you don't have to know the
total number of lines, just the number of lines in the beginning that you
want to get rid of, which you mentioned already was 300.
Jeff
Grant Kelly wrote:
I did play with the tail command, but as mentioned, you still have to
know the total number of lines in the file. `wc -l` took about 5
minutes to calculate this number, and then you've still got to run it
through tail.
Also, I wanted to remove the lines rather than ignore them so that, if
needed, I could reuse the file or pass it on to others without them
having to go through the same problem I did.
Furthermore, the CREATE TABLE commands were preceeded by something
like IF EXISTS DROP table. I had already created the tables and
changed them slightly, so I didn't want them re-created. sed was the
quickest and simplest tool for the job in this case.
So much for a "quick question".... over 30 messages in this thread!
Grant
On 6/30/06, James Washer <[EMAIL PROTECTED]> wrote:
Jeezus...
YES... the tail command gives the last "xx" lines of the files.. but
without counting the lines of the 2+GB file, one has no idea how many
lines that is. Counting the lines of an arbitrarily large file, when there
is no need to do so, is far from efficient.
Further try "cat < head -3 /etc/passwd" and report back on the shell error
you receive. That's just not legal shell syntax.
_______________________________________________
RLUG mailing list
[email protected]
http://lists.rlug.org/mailman/listinfo/rlug