Sponsored Content
Top Forums Shell Programming and Scripting Search for the two patterns and print everything in between Post 302590546 by Scrutinizer on Monday 16th of January 2012 03:50:36 PM
Old 01-16-2012
Code:
sed -n 's/.*#//p' infile

Code:
GTTAATA
GTTA...
.....CT

or do you need to combine the next line?
Code:
sed -n 'N;s/\n//;s/.*#//p' infile

Code:
GTTAATANTTGGGTTTTCT
GTTA...NTTGGGTTTTCT
.....CTNTTGGGTTTTCT

This User Gave Thanks to Scrutinizer For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search patterns

hello, i have an input file of about 50,00,000 lines. few of its lines are as follows: <CR:0023498789,TPO-14987084;BO=IC&SUB=ALLP <CF:0023498789,CB=YES;BIL&NC=NO <CF:0023498789,CW=NO;NS=NO <GC:0023498789,CG=YES;TPO&NC=YES <CR:0024659841,TPO-14484621;BO=NO&BA=OC&SUB=ALLH... (1 Reply)
Discussion started by: rochitsharma
1 Replies

2. Shell Programming and Scripting

Perl print between 2 patterns

I have been unable to find this anywhere; I have a multiline variable, and I want to print the text between two patterns in that variable. So the variable is My real name is not DeadmanAnd I need the output to be this, by printing between "real" and "not" name is or including the two... (10 Replies)
Discussion started by: killer54291
10 Replies

3. Shell Programming and Scripting

awk: Multiple search patterns & print in an one liner

I would like to print result of multiple search pattern invoked from an one liner. The code looks like this but won't work gawk -F '{{if ($0 ~ /pattern1/) pat1=$1 && if ($0 ~ /pattern2/) pat2=$2} ; print pat1, pat2}' Can anybody help getting the right code? (10 Replies)
Discussion started by: sdf
10 Replies

4. Shell Programming and Scripting

To print certain patterns in a column

Hi, From my input files, I want to print $1, $2 and only certain pattern in $4 (EC). I use this code but it print all the words in $4 awk -F"\t" '$4 {print $1,$2,$4}I just want EC follows by the numbers in $4 The input file as follows:- Entry Entry name Status Names Q01284 ... (7 Replies)
Discussion started by: redse171
7 Replies

5. Shell Programming and Scripting

Need to print between patterns AND a few lines before

I need to print out sections (varying numbers of lines) of a file between patterns. That alone is easy enough: sed -n '/START/,/STOP/' I also need the 3 lines BEFORE the start pattern. That alone is easy enough: grep -B3 START But I can't seem to combine the two so that I get everything between the... (2 Replies)
Discussion started by: Finja
2 Replies

6. Shell Programming and Scripting

Search two patterns using awk to print the variable sum

Coins.txt: gold 1 1986 USA American Eagle gold 1 1908 Austria-Hungary Franz Josef 100 Korona silver 10 1981 USA ingot gold 1 1984 Switzerland ingot gold 1 1979 RSA Krugerrand gold 0.5 1981 RSA Krugerrand gold 0.1 1986 PRC Panda silver 1 1986 USA Liberty dollar gold 0.25 1986 USA Liberty... (2 Replies)
Discussion started by: Ramesh M
2 Replies

7. Shell Programming and Scripting

How to print only lines in between patterns?

Hi, I want to print only lines (green-italic lines) in between first and last strings in column 9. there are different number of lines between each strings. 10 AUGUSTUS exon 4558 4669 . - . 10.g1 10 AUGUSTUS exon 8771 8889 . ... (6 Replies)
Discussion started by: jamo
6 Replies

8. Shell Programming and Scripting

Print all lines between patterns

Hi Gurus, I have a requirement where I need to display all lines between 2 patterns except the line where the first pattern in it. I tried the following command using awk but it is printing all lines except the lines where the 2 patterns exist. awk '/TRANSF_/{ P=1; next } /Busy/ {exit} P'... (9 Replies)
Discussion started by: svajhala
9 Replies

9. Shell Programming and Scripting

Print between multiple patterns

Hello Gurus, I have a file this Dir Path 1 Connection pool="somename"; "DataSource Name"="DS name"; Password="pwd"; User Id="uid";some other fields Dir Path2 Password="pwd2"; User id="uid2"; Connection pool="somename2"; "datasource name"="DS name2";some other fields. Under each dir... (14 Replies)
Discussion started by: sirababu
14 Replies

10. Shell Programming and Scripting

Find matched patterns and print them with other patterns not the whole line

Hi, I am trying to extract some patterns from a line. The input file is space delimited and i could not use column to get value after "IN" or "OUT" patterns as there could be multiple white spaces before the next digits that i need to print in the output file . I need to print 3 patterns in a... (3 Replies)
Discussion started by: redse171
3 Replies
PAPS(1) 						      General Commands Manual							   PAPS(1)

NAME
paps - UTF-8 to PostScript converter using Pango SYNOPSIS
paps [options] files... DESCRIPTION
paps reads a UTF-8 encoded file and generates a PostScript language rendering of the file. The rendering is done by creating outline curves through the pango ft2 backend. OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. --landscape Landscape output. Default is portrait. --columns=cl Number of columns output. Default is 1. --font=desc Set the font description. Default is Monospace 12. --rtl Do rtl layout. --paper ps Choose paper size. Known paper sizes are legal, letter, a4. Default is A4. --bottom-margin=bm Set bottom margin in postscript points (1/72 inch). Default is 36. --top-margin=tm Set top margin. Default is 36. --left-margin=lm Set left margin. Default is 36. --right-margin=rm Set right margin. Default is 36. --help Show summary of options. --header Draw page header for each page. --markup Interpret the text as pango markup. --encoding=ENCODING Assume the documentation encoding is ENCODING. --lpi Set the lines per inch. This determines the line spacing. --cpi Set the characters per inch. This is an alternative method of specifying the font size. --stretch-chars Indicates that characters should be stretched in the y-direction to fill up their vertical space. This is similar to the texttops behaviour. AUTHOR
paps was written by Dov Grobgeld <dov.grobgeld@gmail.com>. This manual page was written by Lior Kaplan <kaplan@debian.org>, for the Debian project (but may be used by others). April 17, 2006 PAPS(1)
All times are GMT -4. The time now is 04:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy