Hacker News new | comments | ask | show | jobs | submit login

Have a look at `join', it joins lines of two files on a common field. Together with `cut' and `grep' you can use text-files as relational databases.



>Have a look at `join', it joins lines of two files on a common field. Together with `awk' and `sed' you can use text-files as relational databases.

Fixed it for you.


awk and sed are useful. But as a principle one should use the weakest tool that gets the job done.

That principle also applies to grep regular expressions vs Perl regexes. Regular languages are quite weak in the right way, and thus can be recognized in linear time. Perl's regexes on the other hand, are so powerful, they can even tell prime numbers from composite numbers with their back tracking.

Choosing a weaker tool also serves as documention---about which features not to worry about.

(Of course you shouldn't try to use a tool that's weaker than what you need. For example, trying to solve some problem crying for recursion or iteration in a spreadsheet will lead to more harm than good.)




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: