(Video materials in preparation)
unsco : Remove leading and trailing underscores from fields
Usage : unsco [-l|-r] [<f1> <f2>...] <file>
Version : Tue Jan 9 09:02:34 JST 2024
Edition : 2
Removes leading and trailing underscores from all fields in the file
passed as the argument (or standard input).
If -l or -r option is specfied, only leading or trailing underscores
are removed respectively.
$ cat data
_TOKYO____ 123___
_OSAKA_FU_ _456___
NAGOYA___ ______
$ unsco data
TOKYO 123
OSAKA_FU 456 <-- Underscores within the string are retained
NAGOYA _ <-- If the field is entirely underscors, all
but one are deleted
$ unsco -l data
TOKYO____ 123___ <-- only leading underscores are removed.
OSAKA_FU_ 456___
NAGOYA___ _
$ unsco -r data
_TOKYO 123 <-- only trailing underscores are removed.
_OSAKA_FU _456
NAGOYA _