man uakce
NAME
uakce - Simple (very) file column editor
SYNOPSIS
uakce -ACTION [input-file]
[-output filename] [-verbose] [-quiet] [-trail]
DESCRIPTION
The uakce command is a very simple file editor based primarily on column positions.
Exactly one action can be provided, but results can be piped into another uakce
command. If an input-file is not specified then stdin is assumed.
ACTIONS (exactly one can be specified)
-keep left,right
Keep only specified columns.
-remove left,right
Remove specified columns.
-fold left,right
Fold lines longer than right at last white space after left.
-add after,string
Add string after specified column.
-edit left,right,string
Replace specified columns with string.
-cr
Replace any cr (return) with lf (linefeed).
Same as "-E \\015 -R \\012".
-dos
Use dos/windows *.txt crlf line termination instead of Linux lf.
-Edit string
Use with -Result to perform a binary edit (non-column).
Requires -Output file specification.
Use \ (backslash) for specifying ascii characters as octal values or stan-
dard-C escape sequences. Typically two backslashes will be required as
first is an escape for the invoking shell. This action is useful for edit-
ting files which contain long lines, ascii nulls, or which cannot generally
be opened with most editors.
-copy left,right,after
Copy columns to new location.
-move left,right,after
Move columns to new location.
-duplicate left,right
Duplicate specified columns.
-newline after-nth
Insert newline after everth nth line.
-join after-nth
Remove newline after every nth line.
-backspace
Remove ctrl/h and preceeding character.
-upper
Uppercase anything outside ' or ".
-lower
Lowercase anything outside ' or ".
-tabs
Expands tabs to spaces.
Uses defaults unless -stops specified.
-stops [char][,value[...]]
Specify tab character (default is ascii tab).
Specify tab stops, default stops are:
9,17,25,33,41,49,57,65,73,81,89,97,105,113,121,129.
OPTIONS
-output filename
To specify output file, defaults to stdout.
-verbose
Verbose option to display settings.
-quiet
Do not query for missing values.
-trail
Do not strip off trailing white space.
Must be fully spelled out.
-Result string
Specify result string for -Edit action.
-?
Display terse help message.
EXAMPLES
Insert a tab before every line:
java: uaio -m2 # before
971101.165405 Sleep:1 Iterations:0
Total rz0 rz1 cpu
kbs tps kbs tps kbs tps us ni sy wa id
25 2 . . . . 5 1 9 0 86
java: uaio -m2 | uakce -a0," "
971101.165420 Sleep:1 Iterations:0
Total rz0 rz1 cpu
kbs tps kbs tps kbs tps us ni sy wa id
25 2 . . . . 5 1 9 0 86
Removing columns:
java: vmstat 1 5 | uakce -r22,68
Virtual Memory Statis
procs memory cpu
r w u act free us sy id
5291 16 12K 1074 5 9 86
3293 16 12K 962 3 39 57
4292 16 12K 962 7 22 71
3293 16 12K 962 3 21 76
3293 16 12K 962 3 21 76
Binary edit (not column oriented):
java: ./uakce -E \\101dd -R add Changes.log -o x -verbos
Action -Edit on file Changes.log
Output: x
Replace "\101dd" (3:Add) with "add" (3:add)
File Changes.log had 1 blocks (4096 bytes) and 2776 bytes, 3 substitutions
NOTES
uakce has been tested under IBM/MVS, VAX/VMS, Ultrix, Digital UNIX (OSF1 or Tru64),
IRIX, UNICOS, Solaris, Linux, MacOSX, and Windows cygwin.
This command utilizes the cci command parser utilized by non-UNIX operating systems
instead of the traditional UNIX getopt() parsing. Actions and options have been
defined to "look like" UNIX style options, but can be spelled out or generally
abbreviated. For example -o is the same as -output. Because of this multiple
options must be space separated and the hyphen is part of the option name. Also
because of this order of options and arguments is irrelevant.
ACKNOWLEDGEMENTS
Written at the University of Alaska. Ongoing maintenance via SourceForge by Denali
Sun Consulting.
Suggestions or bug reports can be directed to denalisun907@gmail.com.
RELATED INFORMATION
Commands: awk(1), sed(1), ed(1).