Sums the value in column 9 for each record in file. Since no delimiter is specified, space is the default delimiter.
Prints each record on file as is, i.e. with no changes (can also be written as {print $0} )
After all records from file are read (END), print the string "Total SGD " together with total sum of column 9 (sum) right justified with width of 60 spaces (%60s) followed by new line (\n).
Hello! I have a text file containing
some text : : : bla
other text : : : bla
any text : : : bla
containing 3 columns separated by the ':' sign.
Now i want to insert 'this' in the 2nd line after the 2nd column-deliminiter (i.e. into 3rd column), like
some text : : : bla
other text :... (1 Reply)
Hi,
I am having trouble converting a text file. I have been working for this whole day now, still i couldn't make it.
Here is how the text file looks:
_______________________________________________________
DEVICE STATUS INFORMATION FOR LOCATION 1:
OPER STATES: Disabled E:Enabled ... (5 Replies)
I'm trying to use sed to insert data at a specific column, let's say my data looks like this:
0553 1828
0552 1829
0550 1829
0549 1830
0548 1831
what I want is this:
timein 0553 timeout 1828
timein 0552 timeout 1829
timein 0550 timeout 1829
timein 0549 timeout 1830
timein 0548... (5 Replies)
Hi,
I have the following text file:
8 T1mapping_flip02 ok 128 108 30 1 665000-000008-000001.dcm
9 T1mapping_flip05 ok 128 108 30 1 665000-000009-000001.dcm
10 T1mapping_flip10 ok 128 108 30 1 665000-000010-000001.dcm
11 T1mapping_flip15 ok 128 108 30... (2 Replies)
Hi Everybody,
I am just new to UNIX as well as to this forum. I have a text file with 10,000 coloumns and each coloumn contains values separated by space. I want to separate them into new coloumns..the file is something like this
as ad af 1 A
as ad af 1 D
...
...
1 and A are in one... (7 Replies)
Hi,
I want to insert the text 'Unknown' in 2 specific columns in a csv file (actually | separated) if the column is blank. Its always the same columns.
I have tried using sed: sed "s/||/|Unknown|/g"
but there are occasion where other fields are blank and they need to be left blank. This... (4 Replies)
In Perl. ***edited question below***
Hey all, I am teaching myself some simple CSV file manipulation and have become a little stuck. Say I have the following layout in the CSV file:
age,name,locationIs it possible to INSERT data into the CSV into the correct age order. For example, if I had... (1 Reply)
Hello,
I have some problem in inserting the space for the pairs of columns.
I have the input file :
I used this code below in replacing it using space in specific column (replace space in each two columns)
sed -e "s/,/ /2" -e "s/,/ /3" inputfile
Output showed :
However, I have many... (3 Replies)
Discussion started by: awil
3 Replies
LEARN ABOUT PLAN9
mpm
MPM(6) Games Manual MPM(6)NAME
mpm, mspe - macros for page makeup
SYNOPSIS
troff -mpm file ...
troff -mspe file ...
DESCRIPTION
These troff(1) macros, largely compatible with ms(6), make better pages. They silently invoke and provide information to a postprocessor
that moves floating figures, avoids widows, and justifies pages vertically by stretching vertical spaces that result from .PP, .LP, .IP,
.QP, .SH, .NH, .DS/.DE, .EQ/.EN, .TS/.TE, .PS/.PE, .P1/.P2, and .QS/.QE. The packages support different styles:
-mpm generic
-mspe Software--Practice and Experience
The following macros are different from or not part of -ms. Values denoted n have default value 1v.
.BP Begin a new page.
.FL Flush: force out previous keeps.
.FC Finish a two-column region and start a new one.
.KF m Floating keep, with preferred center at vertical position m. Special values (default) and are permitted.
.NE n Start new page if remaining vertical space on this page is less than n.
.P1 Begin a program display (constant width font).
.P2 End a program display.
.P3 Insert optional break point in program display.
.SP n exactly
.SP n Insert vertical space of height n, stretchable unless exactly is present.
.Tm text
Place page number and text on the standard error output.
.X text
Present text to the hidden page-makeup program as part of a device-dependent output sequence x X text. Equivalent to X'text'.
Useful number registers:
HM Header margin; default 1 inch.
FM Footer margin; default 1 inch.
FO Footer position; default 10 inches.
%# Page number of current page.
dP,dV Shrinkage of point size and vertical spacing for .P1, in points.
Useful strings:
%e,%o Even and odd page title commands, as .tl ''''.
FILES
/sys/lib/tmac/tmac.pm
/$cputype/bin/aux/pm
SOURCE
/sys/src/cmd/pm
SEE ALSO ms(6), troff(1)
B. W. Kernighan and C. J. Van Wyk, ``The -mpm Macro Package'', Unix Research System Programmer's Manual, Tenth Edition, Volume 2.
BUGS
These features of -ms are missing:
Document styles other than the default .RP.
Space between front matter and first paragraph. Recover it with .SP 2.
Separating rule above footnotes.
Keeps assigned to a separate page.
Pages with more than two columns.
Troff option -o doesn't work with -mpm because only the postprocessor knows the page numbers.
MPM(6)