Egzact Versions Save

Generate flexible patterns on the shell

v2.1.1

3 years ago

Fix rpm/deb package bug

v2.1.0

3 years ago

Support Egison 4.1.2 (Many thanks @momohatt !)

v2.0.0

4 years ago
  • Support Egison 4.0.0 (Many thanks @theoremoon !)
  • Cosmetic changes

v1.3.2

4 years ago
  • Support Egison 3.10.3
  • Automated testing with GitHub Actions

v1.3.1

7 years ago

bug fix.

egzact supports double quotation " and backslash \ as any separators (for fs, ofs, ifs, eor, eos).

$ seq 10 | flat ofs='\\"' 3
1\\"2\\"3
4\\"5\\"6
7\\"8\\"9
10

v1.3.0

7 years ago

All the commands did not work with latest Egison version 3.6.3. From this version 1.3.0, egzact supports latest version of Egison as of November 2016.

v1.2.0

7 years ago

What's new?

  1. subsets command was abolished
  2. New commands sublist and subset were newly created.

sublist command

This is same as old subsets command. It prints all the sublists of the input.

$ echo A B C D | sublist
A
A B
B
A B C
B C
C
A B C D
B C D
C D
D

subset command

This is new command. It prints all the "subsets" of the input.

$ echo A B C D | subset
A
B
C
D
A B
A C
B C
A D
B D
C D
A B C
A B D
A C D
B C D
A B C D

v1.1.1

7 years ago

v1.1.0

8 years ago

$ slit

Divide whole the inputs into given number of rows.

# Print A to Z with 3 rows.
$ echo {A..Z} | slit 3
A B C D E F G H I
J K L M N O P Q R
S T U V W X Y Z

# Each line's number of field is adjusted to be near each other as much as possible.
$ echo A B C D | slit 3
A B
C
D

Example

Split the file into 17 indivisual files.

$ seq $(awk 'END{print NR}' mytext) | slit 17 | awk '{print "sed -n "$1","$NF"p mytext > mytext."NR}'
sed -n 1,2p mytext > mytext.1
sed -n 3,4p mytext > mytext.2
sed -n 5,6p mytext > mytext.3
sed -n 7,8p mytext > mytext.4
sed -n 9,10p mytext > mytext.5
sed -n 11,12p mytext > mytext.6
sed -n 13,14p mytext > mytext.7
sed -n 15,15p mytext > mytext.8
sed -n 16,16p mytext > mytext.9
sed -n 17,17p mytext > mytext.10
sed -n 18,18p mytext > mytext.11
sed -n 19,19p mytext > mytext.12
sed -n 20,20p mytext > mytext.13
sed -n 21,21p mytext > mytext.14
sed -n 22,22p mytext > mytext.15
sed -n 23,23p mytext > mytext.16
sed -n 24,24p mytext > mytext.17

# Execute
$ seq $(awk 'END{print NR}' mytext) | slit 17 | awk '{print "sed -n "$1","$NF"p mytext > mytext."NR}' | sh