Sponsored Content
Top Forums Shell Programming and Scripting sed text extraction between 2 patterns using variables Post 302789183 by radudownload on Wednesday 3rd of April 2013 08:29:58 AM
Old 04-03-2013
One more thing; I noticed that the input file has some strange behavior, meaning the last digit always is written on the same position (I've put the an A instead of space character)
Code:
Begin CG move =AAAAAA1
random text
Begin CG move =AAAAA41
random text
Begin CG move =AAAA410
random text

Can sed&awk still be used to extract the random text between two consecutive steps?

Thank you!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SED scipt help - line extraction

Forgive me if this is a dumb question...I'm a Windows sys admin with little programming knowledge. I have files containing anywhere from 3 to 200 lines. Using SED, I want to extract only lines containing a specific instance of "ISS." It is possible that "ISS" will occur several times in a... (10 Replies)
Discussion started by: thuston22
10 Replies

2. Shell Programming and Scripting

extraction of perfect text from file.

Hi All, I have a file of the following format. <?xml version='1.0' encoding='utf-8'?> <tomcat-users> <role rolename="tomcat"/> <role rolename="role1"/> <role rolename="manager"/> <role rolename="admin"/> <user username="tomcat" password="tomcat" roles="tomcat"/> <user... (5 Replies)
Discussion started by: nua7
5 Replies

3. UNIX for Dummies Questions & Answers

Copying Text between two unique text patterns

Dear Colleagues: I have .rtf files of a collection of newspaper articles. Each newspaper article starts with a variation of the phrase "Document * of 20" and is separated from the next article with the character string "===================" I would like to be able to take the text composing... (3 Replies)
Discussion started by: spindoctor
3 Replies

4. Shell Programming and Scripting

extraction of samba shares with sed

Hi there, My samba configuration file looks like that : ... ... path = /home/samba/profiles/ ... path = /home/samba/shares/family valid users = family path = /home/samba/shares/admins valid users = admins path = /home/samba/shares/publicI want to extract the list of standard... (3 Replies)
Discussion started by: chebarbudo
3 Replies

5. UNIX for Dummies Questions & Answers

String extraction from a text file

The following script code works great for extracting 'postmaster' from a line of text stored in a variable named string: string="PenaltyError:=554 5.7.1 Error, send your mail to postmaster@LOCALDOMAIN" stuff=$( echo $string | cut -d@ -f1 | awk '{ print $NF }' ) echo $stuff However, I need to be... (9 Replies)
Discussion started by: cleanden
9 Replies

6. Shell Programming and Scripting

Extraction of text using sed or awk command

Hi All, I need to extract 543 from the command below : # pvscan PV /dev/sdb1 VG vg0 lvm2 Total: 1 543.88 GB] / in use: 1 / in no VG: 0 I have the following command which does the job, but I think this could be achieved in a more simple way using sed or awk. Any help is... (7 Replies)
Discussion started by: nua7
7 Replies

7. Shell Programming and Scripting

Obscure sed extraction syntax

Hi, Could anyone clearly explain me the below sed construct in detail to get to know what it actually does? sed 's/\(* *\)//4' echo 'test;10;20' | sed 's/*;\(*\)/\1/' (1 Reply)
Discussion started by: royalibrahim
1 Replies

8. UNIX for Dummies Questions & Answers

awk/sed match and extraction

Hi, I have a file like this- aa 12 23 34 aa 21 34 56 aa 78 45 56 I want to print out only the lines after the last aa. How do I do this? I tried using grep -A and sed -n, but both didnt work as I wanted to. Could someone help me out please.. (3 Replies)
Discussion started by: jamie_123
3 Replies

9. Shell Programming and Scripting

Text extraction

Dear All, I am trying to extract text from a file containing cron entries. cat /var/tmp/cron_backups/debmed_tmp < * * * * * /bell > * * * * * /belly what I am trying to do is create two text files containing all entries that begin with < and another text files containing entries with > .... (4 Replies)
Discussion started by: Junaid Subhani
4 Replies

10. Shell Programming and Scripting

Extraction problem with sed command

Hi All I am trying to remove the line having specific pattern from a file by using sed command I have the file named ODS_REP_SRCE_File.txt with content as: ... (1 Reply)
Discussion started by: Shilpi Gupta
1 Replies
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.18.1/tmac/me.tmac (a wrapper file for e.tmac) /usr/share/groff/1.18.1/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 Apr 2002 GROFF_ME(7)
All times are GMT -4. The time now is 02:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy