any savant ? using AWK/SED to remove newline character between two strings : conditional removal
I'd like to remove (do a pattern or precise replacement - this I can handle in SED using Regex )
---AFTER THE 1ST Occurrence ( i.e. on the 2nd occurrence - from the 2nd to fourth occurance ) of a specific string : type 1
-- After the 1st occurrence of 1 string1 till the 1st occurrence of string2 not counting the latter.
e.g.
/* Notice How I made the above English incoherent by putting newline breaking words, those newline need to go */
End Transaction ;
- How do I go about knocking of the newline char between Last Begin and End transaction pair
Program Thought : Go find the 3rd Begin transaction statement and knock off the newline until the 1st end transaction statement
Moderator's Comments:
Please use [code] and [/code] tags when posting code, data or logs etc. to preserve formatting and enhance readability, thanks.
Last edited by zaxxon; 03-02-2011 at 03:50 AM..
Reason: code tags
I have a script that produces an output containing '/.ssh'.
I am trying to find a way of parsing only this data from a single line, without removing any other special characters contained within the output as a result of the parse.
Any help would be appreciated (6 Replies)
Hi,
I have input file contains sql queries i need to eliminate newlines from it.
when i open it vi text editor and runs
:%s/'\n/'/g
it provides required result. but when i run sed command from shell prompt it doesn't impact outfile is still same as inputfile.
shell] sed -e... (6 Replies)
Hello
I've got a string of text with a number in pence, e.g. 0.52p, I need to remove the 'p' so that it just reads 0.52 without of course removing all the other 'p' characters.
Many thanks (1 Reply)
hi i am having delimited .dat file having content like below.
test.dat(5 line of records)
======
PT2~Stag~Pt2 Stag Test.
Updated~PT2 S T~Area~~UNCEF R20~~2012-05-24 ~2014-05-24~~
PT2~Stag y~Pt2 Stag Test.
Updated~PT2 S T~Area~METR~~~2012-05-24~2014-05-24~~test
PT2~Pt2 Stag Test~~PT2 S... (4 Replies)
Below am trying to separate FA-7A:1, In output file it should display 7A 1
Command am using
Gives same output as below format:
22B7 10000000c9720873 0
22B7 10000000c95d5d8b 0
22BB 10000000c97843a2 0
22BB 10000000c975adbd 0
Not showing FA ports as required format... (5 Replies)
Below i am trying to remove "/" and "r" from the output, so i need output as:
hdiskpower3
hdisk0
hdisk1
#inq | grep 5773 | awk '{print $1}' | sed 's/dev//g' | awk -F"/" '{$1=$1}1'
.....................................................//rhdiskpower0
//rhdiskpower1
//rhdiskpower2... (3 Replies)
Hi all..
I have a text file which looks like below:
abcd
efgh
ijkl
(blank space)
I need to remove only the last (blank space) from the file. When I try wc -l the file name,the number of lines coming is 3 only, however blank space is there in the file.
I have tried options like... (14 Replies)
Here is my task, I feel sure this can be accomplished with see/awk but can't seem to figure out how.
I have large flat file from which I need to extract every case of a pairing of characters (GG) in this case PLUS the previous 20 characters. The output should be a list (which I plan to make... (17 Replies)
Hi all,
I need to remove DBPATH= and /db from the string below using awk (or sed, as it also exists on the machine).
Input: DBPATH=/some/path/database/db
Desired output: /some/path/database
Thank you! (8 Replies)
I have a file which comes every day and the file data look's as below.
Vi abc.txt
a|b|c|d\n
a|g|h|j\n
Some times we receive the file with only a new line character in the file like
vi abc.txt
\n (8 Replies)
Discussion started by: rak Kundra
8 Replies
LEARN ABOUT DEBIAN
groff_me
GROFF_ME(7) Miscellaneous Information Manual GROFF_ME(7)NAME
groff_me - troff macros for formatting papers
SYNOPSIS
groff -me [ options ] file ...
groff -m me [ options ] file ...
DESCRIPTION
This manual page describes the GNU version of the -me macros, which is part of the groff document formatting system. This version can be
used with both GNU troff and Unix troff. This package of troff macro definitions provides a canned formatting facility for technical
papers in various formats.
The macro requests are defined below. Many troff requests are unsafe in conjunction with this package, however, these requests may be used
with impunity after the first .pp:
.bp begin new page
.br break output line here
.sp n insert n spacing lines
.ls n (line spacing) n=1 single, n=2 double space
.na no alignment of right margin
.ce n center next n lines
.ul n underline next n lines
Output of the pic, eqn, refer, and tbl preprocessors is acceptable as input.
FILES
/usr/share/groff/1.21/tmac/me.tmac (a wrapper file for e.tmac)
/usr/share/groff/1.21/tmac/e.tmac
SEE ALSO groff(1), troff(1)-me Reference Manual, Eric P. Allman
Writing Papers with Groff Using -me
REQUESTS
This list is incomplete; see The -me Reference Manual for interesting details.
Request Initial Cause Explanation
Value Break
.(c - yes Begin centered block
.(d - no Begin delayed text
.(f - no Begin footnote
.(l - yes Begin list
.(q - yes Begin major quote
.(x x - no Begin indexed item in index x
.(z - no Begin floating keep
.)c - yes End centered block
.)d - yes End delayed text
.)f - yes End footnote
.)l - yes End list
.)q - yes End major quote
.)x - yes End index item
.)z - yes End floating keep
.++ m H - no Define paper section. m defines the part of the paper, and can be C (chapter), A (appendix), P (preliminary, e.g.,
abstract, table of contents, etc.), B (bibliography), RC (chapters renumbered from page one each chapter), or RA (ap-
pendix renumbered from page one).
.+c T - yes Begin chapter (or appendix, etc., as set by .++). T is the chapter title.
.1c 1 yes One column format on a new page.
.2c 1 yes Two column format.
.EN - yes Space after equation produced by eqn or neqn.
.EQ x y - yes Precede equation; break out and add space. Equation number is y. The optional argument x may be I to indent equation
(default), L to left-adjust the equation, or C to center the equation.
.GE - yes End gremlin picture.
.GS - yes Begin gremlin picture.
.PE - yes End pic picture.
.PS - yes Begin pic picture.
.TE - yes End table.
.TH - yes End heading section of table.
.TS x - yes Begin table; if x is H table has repeated heading.
.b x no no Print x in boldface; if no argument switch to boldface.
.ba +n 0 yes Augments the base indent by n. This indent is used to set the indent on regular text (like paragraphs).
.bc no yes Begin new column
.bi x no no Print x in bold italics (nofill only)
.bu - yes Begin bulleted paragraph
.bx x no no Print x in a box (nofill only).
.ef 'x'y'z' '''' no Set even footer to x y z
.eh 'x'y'z' '''' no Set even header to x y z
.fo 'x'y'z' '''' no Set footer to x y z
.hx - no Suppress headers and footers on next page.
.he 'x'y'z' '''' no Set header to x y z
.hl - yes Draw a horizontal line
.i x no no Italicize x; if x missing, italic text follows.
.ip x y no yes Start indented paragraph, with hanging tag x. Indentation is y ens (default 5).
.lp yes yes Start left-blocked paragraph.
.np 1 yes Start numbered paragraph.
.of 'x'y'z' '''' no Set odd footer to x y z
.oh 'x'y'z' '''' no Set odd header to x y z
.pd - yes Print delayed text.
.pp no yes Begin paragraph. First line indented.
.r yes no Roman text follows.
.re - no Reset tabs to default values.
.sh n x - yes Section head follows, font automatically bold. n is level of section, x is title of section.
.sk no no Leave the next page blank. Only one page is remembered ahead.
.sm x - no Set x in a smaller pointsize.
.sz +n 10p no Augment the point size by n points.
.tp no yes Begin title page.
.u x - no Underline argument (even in troff). (Nofill only).
.uh - yes Like .sh but unnumbered.
.xp x - no Print index x.
3rd Berkeley Distribution 31 December 2010 GROFF_ME(7)