Hi.
Here are additional results with tools available from repositories or from the net:
Code snippet:
pl " Results for sequence \"arrange -f 1 2 1 4-5 7\":"
arrange -f '1 2 1 4-5 7' $FILE |
align
pe " (\"arrange\" is a work in progress)"
pl " Results for sequence \"csvtool -t \" \" -u \" \" col 1,2,1,4-5,6-\":"
csvtool -t " " -u " " col 1,2,1,4-5,6- $FILE
pl " Results for spit - create fields of data:"
spit -r 3 -v "2.71828"
pl " Results for \"csvfix -f 1,2,1,4-5\":"
csvfix read_dsv -s " " -f 1,2,1,4:5 $FILE |
tee f1 |
csvfix put -v "1.0" |
tee f2 |
csvfix write_dsv -s " " |
tee f3
pl " Results for add_field, part of CRUSH toolset:"
add_field -l "target" -v "3.14" -A "i" -d " " $FILE
pl " Results for add_field, part of CRUSH toolset:"
add_field -l "target" -v "3.14" -f 100 -d " " $FILE
producing:
-----
Results for sequence "arrange -f 1 2 1 4-5 7":
a b a d e g
1,1 1,2 1,1 1,4 1,5 1,7
2,1 2,2 2,1 2,4 2,5 2,7
3,1 3,2 3,1 3,4 3,5 3,7
("arrange" is a work in progress)
-----
Results for sequence "csvtool -t " " -u " " col 1,2,1,4-5,6-":
a b a d e f g h i
1,1 1,2 1,1 1,4 1,5 1,6 1,7 1,8 1,9
2,1 2,2 2,1 2,4 2,5 2,6 2,7 2,8 2,9
3,1 3,2 3,1 3,4 3,5 3,6 3,7 3,8 3,9
-----
Results for spit - create fields of data:
2.71828
2.71828
2.71828
-----
Results for "csvfix -f 1,2,1,4-5":
a b a d e 1.0
1,1 1,2 1,1 1,4 1,5 1.0
2,1 2,2 2,1 2,4 2,5 1.0
3,1 3,2 3,1 3,4 3,5 1.0
-----
Results for add_field, part of CRUSH toolset:
a b c d e f g h i target
1,1 1,2 1,3 1,4 1,5 1,6 1,7 1,8 1,9 3.14
2,1 2,2 2,3 2,4 2,5 2,6 2,7 2,8 2,9 3.14
3,1 3,2 3,3 3,4 3,5 3,6 3,7 3,8 3,9 3.14
-----
Results for add_field, part of CRUSH toolset:
a b c d e f g h i target
1,1 1,2 1,3 1,4 1,5 1,6 1,7 1,8 1,9 3.14
2,1 2,2 2,3 2,4 2,5 2,6 2,7 2,8 2,9 3.14
3,1 3,2 3,3 3,4 3,5 3,6 3,7 3,8 3,9 3.14
recut Process fields like cut, allow repetitions and re-ordering. (what)
Path : ~/bin/recut
Version : - ( local: RepRev 1.1, ~/bin/recut, 2010-06-10 )
Length : 56 lines
Type : Perl script, ASCII text executable
Shebang : #!/usr/bin/perl
Home : http://www1.cuni.cz/~obo/textutils/
Modules : (for perl codes)
Getopt::Long 2.42
arrange Arrange fields, like cut, but in user-specified order. (what)
Path : ~/bin/arrange
Version : 1.15
Length : 355 lines
Type : Perl script, ASCII text executable
Shebang : #!/usr/bin/perl
Modules : (for perl codes)
warnings 1.23
strict 1.08
Carp 1.3301
Getopt::Euclid 0.4.5
spit Generate, create structured data sequence, -r rows of -v values in -c columns. (what)
Path : ~/bin/spit
Version : - ( local: RepRev 1.10, ~/bin/spit, 2015-08-13 )
Length : 80 lines
Type : awk or perl script, ASCII text
Shebang : #!/usr/bin/env bash
csvtool tool for performing manipulations on CSV files from sh... (man)
Path : /usr/bin/csvtool
Version : - ( /usr/bin/csvtool, 2014-08-06 )
Type : ELF 64-bit LSB executable, x86-64, version 1 (SYSV ...)
Help : probably available with --help
Home : https://github.com/Chris00/ocaml-csv
csvfix Manipulate csv files, file:///home/dennisl/src/csvfix/csvfix16/csvfix.html?Introduction.html (local html) (doc)
Path : ~/executable/csvfix
Version : - ( local: ~/executable/csvfix, 2014-05-17 )
Type : ELF 64-bit LSB executable, x86-64, version 1 (SYSV ...)
Home : http://neilb.bitbucket.org/csvfix/
add_field adds a field to a string-delimited log file. (man)
Path : /usr/local/bin/add_field
Version : - ( local: /usr/local/bin/add_field, 2016-11-28 )
Length : 273 lines
Type : a /usr/bin/perl -w script, ASCII text executable
Shebang : #!/usr/bin/perl -w
Help : probably available with [ ]-h,--help
Home : https://github.com/google/crush-tools
Modules : (for perl codes)
strict 1.08
Getopt::Long 2.42
Carp 1.3301
Of interest may be csvfix
which allows a sub-command put
to create a new field.
The local spit
creates fields of values (or location in a matrix).
The CRUSH toolset includes add_field
with a name and value.
The details above show the homes for the toolsets.
Best wishes ... cheers, drl