Cool command of the week... "head"
Head reads part of a file, this an be done by lines, or by bytes. It's faster by bytes, for obvious disk IO reasons, but line numbers will probably be more useful in most cases anyway.
Here's a sample....
head -n 99000000 mozdl.tsv | tail -n 1;
-n 99000000 tells the machine to read from the 99 millionth line of mozdl.tsv
| tail -n 1 tells the machine how many lines to output from where it began... one
I find myself using this command a lot, especially with bytes to jump around a file to sample data without having to expend cycles processing \n characters.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment