still, on international man page appreciate day this is a great reference. the only thing it is missing is gnuplot ascii graphs.
Useful Unix commands for exploring data
81–90 of 156 posts
Re: Useful Unix commands for exploring data
#82Earlier quoted context omitted.
Most scripting languages aren't multithreaded, and some aren't pipeline oriented by default. For example, working with file lines naively in Ruby means reading the whole lot into a giant array and doing transformations an array at a time, rather than in a streaming fashion. The shell gives you fairly safe concurrency and streaming for free. Personally, if it's a complex task, I generally write a tool such that it can…
No the case with ruby at all, if you're reading the whole file into memory theres a good chance you're doing it wrong. check out yield and blocks
GP: "working with file lines _naively_ in Ruby"
Re: Useful Unix commands for exploring data
#83'nuff said.
Re: Useful Unix commands for exploring data
#84Earlier quoted context omitted.
Most scripting languages aren't multithreaded, and some aren't pipeline oriented by default. For example, working with file lines naively in Ruby means reading the whole lot into a giant array and doing transformations an array at a time, rather than in a streaming fashion. The shell gives you fairly safe concurrency and streaming for free. Personally, if it's a complex task, I generally write a tool such that it can…
No the case with ruby at all, if you're reading the whole file into memory theres a good chance you're doing it wrong. check out yield and blocks
Re: Useful Unix commands for exploring data
#85Re: Useful Unix commands for exploring data
#86"While dealing with big genetic data sets I often got stuck with limitation of programming languages in terms of reading big files." Hate to sound like Steve-Jobs here, but: "You're using it wrong." Let me elaborate. If you're coming across limitations of "too-big" or "too-long" in your language of choice: Then you're just a few searches away from both being enlightened on how to solve your task at hand and on how yo…
> always use the right tool for the job Standard grep is much faster on multi-gigabyte files than anything you can figure out how to do in your pet language. By the time you get close to matching grep, you would have reimplemented most of grep, in half-assed fashion at that. Your delusion is assuming standard command line tools are simple in function because they have a simple interface that Average Joe can use.
One liner shell commands often turn complicated quickly.
Re: Useful Unix commands for exploring data
#87>> If we don't want new file we can redirect the output to same file which will overwrite original file You need to be a little careful with that. If you do: uniq -u movies.csv > movies.csv The shell will first open movies.csv for writing (the redirect part) then launch the uniq command connecting stdout to the now emptied movies.csv. Of course when uniq opens movies.csv for consumption, it'll already be empty. There…
Re: Useful Unix commands for exploring data
#88Re: Useful Unix commands for exploring data
#89If you're on Windows, you owe it to yourself to check out a little known Microsoft utility called logparser: http://mlichtenberg.wordpress.com/2011/02/03/log-parser-rock... It effectively lets you query a CSV (or many other log file formats/sources) with a SQL-like language. Very useful tool that I wish was available on Linux systems.
Re: Useful Unix commands for exploring data
#90>> If we don't want new file we can redirect the output to same file which will overwrite original file You need to be a little careful with that. If you do: uniq -u movies.csv > movies.csv The shell will first open movies.csv for writing (the redirect part) then launch the uniq command connecting stdout to the now emptied movies.csv. Of course when uniq opens movies.csv for consumption, it'll already be empty. There…
Thank you for inputs, how about this? uniq -u movies.csv > temp.csv temp.csv > movie.csv rm temp.csv
The rename is atomic; anyone opening "filename" will get either the old version, or the new version. (Although it breaks one of my other favorite idioms for monitoring log files, "tail -f filename", because the old inode will never be updated.)