I am looking to replace two or more strings on different lines using sed, but not with the same variable. IE
# cat xxx.file
<abc>
abc def ghi
abc def ghi
abc def ghi
currently I can only change each line with the same pattern:
# sed -e '/<abc>/!s/abc\(.*\)/jkl mno/' xxx.file
abc jkl mno... (3 Replies)
Hello Experts,
I have two files called "old" and "new". My old file contains 10 lines and my new file contains 10 + "n" lines.
The first field in both these files contain ID. I sort these two files on ID. I am interested in only the lines that are in the new file and not in old.
I tried... (4 Replies)
Hi,
I have an issue to combine multiple lines of a file. I have records as below.
Fields are delimited by TAB. Each lines are ending with a new line char (\n)
Input
--------
ABC 123456 abcde 987
890456 7890 xyz
ght gtuv
ABC 5tyin 1234 789
ghty kuio
ABC ghty jind 1234
678 ght
... (8 Replies)
I am trying to extract a table of data (mysql query output) from a log file. I need to print everything below the header and not past the end of the table. I have spent many hours searching with little progress. I am matching the regexp +-\{99\} with no problem. I just can't figure out how to print... (5 Replies)
In the below awk I am trying to combine all matching $4 into a single $5 (up to the -), and count the lines in $6 and average all values in $7. The awk is close but it seems to only be using the last line in the file and skipping all others. The posted input is a sample of the file that is over... (3 Replies)
Hi,
For example:
I have:
HostA,XYZ
HostB,XYZ
HostC,ABC
I would like the output to be:
HostA,HostB: XYZ
HostC:ABC
How can I achieve this?
So far what I though of is: (1 Reply)
Hi,
I have a file as follows.
file1
Hello
Hi
His
Hi
Hi
Hungry
hi
so I want to delete identical lines while leaving one of them undeleted.
So desired output will be
Hello
Hi (2 Replies)
I have some data that looks like this:
PXD= ZW< 1,6
QR> QRJ== 1,2(5)
QR> QRJ== 4,1(2)
QR> QRJ== 4,2
QRB= QRB 4,2
QWM QWM 6,2
R<C ZW< 11,2
R<H= R<J= 6,1
R>H XZJ= 1,2(2)
R>H XZJ= 2,6(2)
R>H XZJ= 4,1(2)
R>H XZJ= 6,2
RDP RDP 1,2
What I would like to do is if fields $1 and $2 are... (5 Replies)
Discussion started by: jvoot
5 Replies
LEARN ABOUT MINIX
roff
is a text formatter. Its input consists of the text to be out-
put, intermixed with formatting commands. A formatting commandis a line containing the control character followed by a twocharacter command name, and possibly one or more arguments. Thecontrol character is initially . (dot). The formatted output isproduced on standard output. The formatting commands are listedbelow, with being a number, being a character, and being a title.A + before n means it may be signed, indicating a positive ornegative change from the current value. Initial values for whererelevant, are given in parentheses.
.ad Adjust right margin.
.ar Arabic page numbers.
.br Line break. Subsequent text will begin on a new line.
.bl n Insert n blank lines.
.bp +n Begin new page and number it n. No n means +1.
.cc c Control character is set to c.
.ce n Center the next n input lines.
.de zz Define a macro called zz. A line with .. ends definition.
.ds Double space the output. Same as .ls 2.
.ef t Even page footer title is set to t.
.eh t Even page header title is set to t.
.fi Begin filling output lines as full as possible.
.fo t Footer titles (even and odd) are set to t.
.hc c The character c (e.g., %) tells roff where hyphens are permitted.
.he t Header titles (even and odd) are set to t.
.hx Header titles are suppressed.
.hy n Hyphenation is done if n is 1, suppressed if it is 0. Default is 1.
.ig Ignore input lines until a line beginning with .. is found.
.in n Indent n spaces from the left margin; force line break.
.ix n Same as .in but continue filling output on current line.
.li n Literal text on next n lines. Copy to output unmodified.
.ll +n Line length (including indent) is set to n (65).
.ls +n Line spacing: n (1) is 1 for single spacing, 2 for double, etc.
.m1 n Insert n (2) blank lines between top of page and header.
.m2 n Insert n (2) blank lines between header and start of text.
.m3 n Insert n (1) blank lines between end of text and footer.
.m4 n Insert n (3) blank lines between footer and end of page.
.na No adjustment of the right margin.
.ne n Need n lines. If fewer are left, go to next page.
.nn +n The next n output lines are not numbered.
.n1 Number output lines in left margin starting at 1.
.n2 n Number output lines starting at n. If 0, stop numbering.
.ni +n Indent line numbers by n (0) spaces.
.nf No more filling of lines.
.nx f Switch input to file f.
.of t Odd page footer title is set to t.
.oh t Odd page header title is set to t.
.pa +n Page adjust by n (1). Same as .bp
.pl +n Paper length is n (66) lines.
.po +n Page offset. Each line is started with n (0) spaces.
.ro Page numbers are printed in Roman numerals.
.sk n Skip n pages (i.e., make them blank), starting with next one.
.sp n Insert n blank lines, except at top of page.
.ss Single spacing. Equivalent to .ls 1.
.ta Set tab stops, e.g., .ta 9 17 25 33 41 49 57 65 73 (default).
.tc c Tabs are expanded into c. Default is space.
.ti n Indent next line n spaces; then go back to previous indent.
.tr ab Translate a into b on output.
.ul n Underline the letters and numbers in the next n lines.