Sponsored Content
Top Forums UNIX for Dummies Questions & Answers retrieve lines that match a pattern Post 302265964 by fadista on Tuesday 9th of December 2008 03:37:20 AM
Old 12-09-2008
retrieve lines that match a pattern

Hi,

I would like to know how can I get lines from a text file that match no more than 2 '>'. Example:

Input file:
a >cr1 4 a>b b>c
a >cr2 5 a>b

Output file:
a >cr2 5 a>b


Thanks in advance
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to delete lines do NOT match a pattern

On Unix, it is easy to get those lines that match a pattern, by grep pattern file or those lines that do not, by grep -v pattern file but I am editing a file on Windows with Ultraedit. Ultraedit support regular expression based search and replace. I can delete all the lines that match a... (1 Reply)
Discussion started by: JumboGeng
1 Replies

2. Shell Programming and Scripting

Match a pattern and copy above two lines

Dear experts, i want to search pattern tre and copy this line and above two lines in a seperate file:: Thanks for the help SEV="MAJOR": RX-TX HW-FAILURE DOMAIN="alcomc2_BSS_20 unit-type % bts nbr % 24 SBL-type % tre nbr % 4 subnb % 255 BR, Danish (16 Replies)
Discussion started by: Danish Shakil
16 Replies

3. Shell Programming and Scripting

Print lines before and after pattern match

I am using Solaris, I want to print 3 lines before pattern match pattern 5 lines after pattern match Pattern is abcd to be searched in a.txt. Looking for the solution in sed/awk/perl. Thanks .. Input File a.txt: ================= 1 2 3 abcd 4 5 6 7 8 (7 Replies)
Discussion started by: manuswami
7 Replies

4. Shell Programming and Scripting

Need one liner to search pattern and print everything expect 6 lines from where pattern match made

i need to search for a pattern from a big file and print everything expect the next 6 lines from where the pattern match was made. (8 Replies)
Discussion started by: chidori
8 Replies

5. Shell Programming and Scripting

Retrieve lines that match any occurence in a list of patterns

I have two files. The first containing a header and six columns of data. Example file 1: Number SNP ID dbSNP RS ID Chromosome Result_Call Physical Position 787066 SNP_A-8575395 RS6650104 1 NOCALL 564477 786872 SNP_A-8575125 RS10458597 1 AA ... (13 Replies)
Discussion started by: Selftaught
13 Replies

6. UNIX for Dummies Questions & Answers

Join the lines until next pattern match

Hi, I have a data file where data is splitted into multiple lines. And, each valid record starts with a patten date | <?xml and ends with pattern </dmm> e.g. 20120924|<?xml record 1 line1....record 1 line1....record 1 line1.... record 1 line2....record 1 line2....record 1 line2.... record 1... (3 Replies)
Discussion started by: Dipalik
3 Replies

7. Shell Programming and Scripting

Print lines that do not match the pattern

I need to print the lines that do not match a pattern. I tried using grep -v and sed -n '/pattern/!p', but both of them are not working as I am passing the pattern as variable and it can be null some times. Example ........ abcd...... .........abcd...... .........abcd......... (4 Replies)
Discussion started by: sunny1234
4 Replies

8. Shell Programming and Scripting

Extract lines that match a pattern

Hi all, I got a file that contains the following content, Actually it is a part of the file content, Installing XYZ XYZA Image, API 18, revision 2 Unzipping XYZ XYZA Image, API 18, revision 2 (1%) Unzipping XYZ XYZA Image, API 18, revision 2 (96%) Unzipping XYZ XYZA Image, API 18,... (7 Replies)
Discussion started by: Kashyap
7 Replies

9. Shell Programming and Scripting

Printing next 6 lines from of pattern match

Hi, i have a big file having many opcodes. if (opcode="01110000000100000000" ) then --fadd result.opcode := "01110000000100000000"; result.s0 := '1'; result.s1 := '1'; result.s2 := '0'; result.inst := '0'; result.scalar := '1';... (7 Replies)
Discussion started by: twistedpair
7 Replies

10. Shell Programming and Scripting

Match Pattern and print pattern and multiple lines into one line

Hello Experts , require help . See below output: File inputs ------------------------------------------ Server Host = mike id rl images allocated last updated density vimages expiration last read <------- STATUS ------->... (4 Replies)
Discussion started by: tigerhills
4 Replies
mlib_VideoColorJFIFYCC2RGB420(3MLIB)			    mediaLib Library Functions			      mlib_VideoColorJFIFYCC2RGB420(3MLIB)

NAME
mlib_VideoColorJFIFYCC2RGB420 - JFIF YCbCr to RGB color conversion SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_VideoColorJFIFYCC2RGB420(mlib_u8 *rgb0, mlib_u8 *rgb1, const mlib_u8 *y0, const mlib_u8 *y1, const mlib_u8 *cb0, const mlib_u8 *cr0, const mlib_u8 *cb1, const mlib_u8 *cr1, const mlib_u8 *cb2, const mlib_u8 *cr2, mlib_s32 n); DESCRIPTION
The mlib_VideoColorJFIFYCC2RGB420() function performs color space conversion from YCbCr to RGB together with sampling rate conversion when used in the JPEG File Interchange Format (JFIF). PARAMETERS
The function takes the following arguments: rgb0 Pointer to upper destination RGB multi-component row. rgb0 must be 8-byte aligned. rgb1 Pointer to lower destination RGB multi-component row. rgb1 must be 8-byte aligned. y0 Pointer to upper destination Y component row. y0 must be 8-byte aligned. y1 Pointer to lower destination Y component row. y1 must be 8-byte aligned. cb0 Pointer to source upper Cb component row. cb0 must be 8-byte aligned. cr0 Pointer to source upper Cr component row. cr0 must be 8-byte aligned. cb1 Pointer to source middle Cb component row. cb1 must be 8-byte aligned. cr1 Pointer to source middle Cr component row. cr1 must be 8-byte aligned. cb2 Pointer to source lower Cb component row. cb2 must be 8-byte aligned. cr2 Pointer to source lower Cr component row. cr2 must be 8-byte aligned. n Length of Y component row. n must be even. The length of Cb and Cr component rows must be n/2. The length of the RGB multi-compo- nent row must be 3*n. RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_VideoColorJFIFYCC2RGB420_Nearest(3MLIB), mlib_VideoColorJFIFYCC2RGB422(3MLIB), mlib_VideoColorJFIFYCC2RGB422_Nearest(3MLIB), attributes(5) SunOS 5.11 23 May 2007 mlib_VideoColorJFIFYCC2RGB420(3MLIB)
All times are GMT -4. The time now is 09:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy