2 ms·
Nice article. I actually worked for a Japanese company that uses relational shell scripting for developing web systems. They use space separated tables and have
by byambatsogt 15y ago
Nice article. I actually worked for a Japanese company that uses relational shell scripting for developing web systems. They use space separated tables and have developed a set of commands to process text files. Those commands are pretty useful and easy to use. Few examples would be:
- self 1 2 fileName - selects first and second column from the file. There is corresponding tagself command which assumes the first row of the file is the column name.
- Join commands which are essentially implementations of sql joins.
- Sum commands. One that I remember is sm2.
$ cat data
a 15 asdf
a 30 aaa
b 13 bbb
$ sm 1 2 data
a 45
b 13
So you would chain these with unix native commands such as awk, sed, grep and do some interesting stuff. Here is a very simple example shows how it would look like:
cat data | self 1 2 | sm 1 2 | grep some_expression > new-data
There is a lot other of these commands that do various sort of thing with text and html files. Anyone who understands japanese might wanna check this out http://www.youtube.com/watch?v=1MYKp7dswQg http://www.youtube.com/watch?v=1MYKp7dswQg.