Does anyone know how to get these two output lines into one colon ':' separated line with some unix command? Maybe nawk. I've tried to read the nawk and awk man pages but I don't get it right. Are these commands the one to use?
Output from find command:
#
/sw/tools/matlab/7.0.1/man... (2 Replies)
How do I deal with extracting a portion of a record when multiple field separators are involved.
Let's say I have:
Mike Harrington;(555) 555-5555:250:100:175
Christian Dobbins;(555) 555-2358:155:90:201
Susan Dalsass;(555) 555-6279:250:60:50
Archie McNichol;(555) 555-1348:250:100:175
Jody... (3 Replies)
OS=HP-UX ksh
The following works, except I want to include the <start> and <end> in the output.
awk -F '<start>' 'BEGIN{RS="<end>"; OFS="\n"; ORS=""} {print $2} somefile.log'
The following work in bash but not in ksh
sed -n '/^<start>/,/^<end>/{/LABEL$/!p}' somefile.log (4 Replies)
Hi,
Is there a way in Korn Shell that I can run multiple commands stored as a semi-colon separated string, e.g.,
# vs="echo a; echo b;"
# $vs
a; echo b;
I want to be able to store commands in a variable, then run all of it once and pipe the whole output to another program without using... (2 Replies)
I'm using AIX 5.3 and running a awk replace to modify data as follows:
echo 1234: 1234 123 123 444 555 666 7777 | awk '/^:/{split($2,N);n=N} {n=$1} {sub(n,n+10000000)}1'
10001234 1234 123 123 444 555 666 7777
dumb question.. how do I get the colon back in, so it outputs
10001234: 1234... (4 Replies)
Experts, how to sort this fields with numerical order :
-How to use the sort command in this case, I was thinking with -k but it is not working,
lan5000
lan5000:1
lan5000:10
lan5000:11
lan5000:12
lan5000:13
lan5000:14
lan5000:15
lan5000:16
lan5000:17 ... (6 Replies)
Hi experts ,
I am trying to get the below output:
file :
0/6/4/1 0x0019503C2E26 5 UP lan5 snap5 1 ETHER Yes 224
0/6/4/0 0x0019503C2E25 6 UP lan6 snap6 2 ETHER Yes 224
0/2/1/0 0x0019503E6900 0 UP lan0 snap0 3 ETHER Yes 224... (8 Replies)
After some thought.
I am uncomfortable issuing my professors name where, there may be unintended side effects from any negative responses/feedback. Willing to re post if I can omit school / professor publicly, but can message moderator for validation? I am here for knowledge and understanding,... (1 Reply)
I am using awk to search $5 of the "input" file using the "list" file as the search criteria. So if the id in line 1 of "list" is found in "search" then it is counted in the ids found. However, if the line in "list" is not found in "search", then it is outputted as is missing. The awk below runs... (3 Replies)
Trying to get the unique count of the below input, but if the text in beginning of $5 is a partial match to another line in the file then it is not unique.
awk
awk '!seen++ {n++} END {print n}' input
7 input
chr1 159174749 159174770 chr1:159174749-159174770 ACKR1
chr1 ... (2 Replies)
Discussion started by: cmccabe
2 Replies
LEARN ABOUT PLAN9
tbl
TBL(1) General Commands Manual TBL(1)NAME
tbl - format tables for nroff or troff
SYNOPSIS
tbl [ file ... ]
DESCRIPTION
Tbl is a preprocessor for formatting tables for nroff or troff(1). The input files are copied to the standard output, except for segments
of the form
.TS
options ;
format .
data
.T&
format .
data
. . .
.TE
which describe tables and are replaced by troff requests to lay out the tables. If no arguments are given, tbl reads the standard input.
The (optional) options line is terminated by a semicolon and contains one or more of
center center the table; default is left-adjust
expand make table as wide as current line length
box
doublebox
enclose the table in a box or double box
allbox enclose every item in a box
tab(x) use x to separate input items; default is tab
linesize(n)
set rules in n-point type
delim(xy)
recognize x and y as eqn(1) delimiters
Each line, except the last, of the obligatory format describes one row of the table. The last line describes all rows until the next .T&,
where the format changes, or the end of the table at .TE. A format is specified by key letters, one per column, either upper or lower
case:
L
Left justify: the default for columns without format keys.
R
Right justify.
C
Center.
N
Numeric: align at decimal point (inferred for integers) or at
S
Span: extend previous column across this one.
A
Alphabetic: left-aligned within column, widest item centered, indented relative to L rows.
^
Vertical span: continue item from previous row into this row.
-
Draw a horizontal rule in this column.
=
Draw a double horizontal rule in this column.
Key letters may be followed by modifiers, also either case:
| Draw vertical rule between columns.
|| Draw a double vertical rule between columns.
n Gap between column is n ens wide. Default is 3.
Ffont Use specified font. B and I mean FB and FI.
T Begin vertically-spanned item at top row of range; default is vertical centering (with
Pn Use point size n.
Vn Use n-point vertical spacing in text block; signed n means relative change.
W(n) Column width as a troff width specification. Parens are optional if n is a simple integer.
E Equalize the widths of all columns marked E.
Each line of data becomes one row of the table; tabs separate items. Lines beginning with are troff requests. Certain special data items
are recognized:
_
Draw a horizontal rule in this column.
=
Draw a double horizontal rule in this column. A data line consisting of a single or draws the rule across the whole table.
\_
Draw a rule only as wide as the contents of the column.
Rx
Repeat character x across the column.
^
Span the previous item in this column down into this row.
T{
The item is a text block to be separately formatted by troff and placed in the table. The block continues to the next line begin-
ning with T}. The remainder of the data line follows at that point.
When it is used in a pipeline with eqn, the tbl command should be first, to minimize the volume of data passed through pipes.
EXAMPLES
Let <tab> represent a tab (which should be typed as a genuine tab).
.TS
c s s
c c s
c c c
l n n.
Household Population
Town<tab>Households
<tab>Number<tab>Size
Bedminster<tab>789<tab>3.26
Bernards Twp.<tab>3087<tab>3.74
Bernardsville<tab>2018<tab>3.30
.TE
Household Population
Town Households
Number Size
Bedminster 789 3.26
Bernards Twp. 3087 3.74
Bernardsville 2018 3.30
SOURCE
/sys/src/cmd/tbl
SEE ALSO troff(1), eqn(1), doctype(1)
M. E. Lesk and L. L. Cherry, ``TBL--a Program to Format Tables'', Unix Research System Programmer's Manual, Tenth Edition, Volume 2.
TBL(1)