Sponsored Content
Top Forums UNIX for Dummies Questions & Answers exclude columns with a matching line pattern Post 302209830 by greptastic on Saturday 28th of June 2008 05:20:25 PM
Old 06-28-2008
exclude columns with a matching line pattern

Hi ,

I have 5 columns total and am wanting to search lines in columns 3-5 and basically grep -v patterns that match 'BBB_0123' 'BVG_0895' 'BSD_0987'

Does anyone know how to do this? I tried combining grep -v with grep -e but, it didn't work.

Thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

comment/delete a particular pattern starting from second line of the matching pattern

Hi, I have file 1.txt with following entries as shown: 0152364|134444|10.20.30.40|015236433 0233654|122555|10.20.30.50|023365433 ** ** ** In file 2.txt I have the following entries as shown: 0152364|134444|10.20.30.40|015236433 0233654|122555|10.20.30.50|023365433... (4 Replies)
Discussion started by: imas
4 Replies

2. Shell Programming and Scripting

using command line arguments as columns for pattern matching using awk

Hi, I wish to use a column, as inputted by a user from command line, for pattern matching. awk file: { if($1 ~ /^8/) { print $0> "temp2.csv" } } something like this, but i want '$1' to be any column as selected by the user from command line. ... (1 Reply)
Discussion started by: invinclible0009
1 Replies

3. Shell Programming and Scripting

How to use sed to modify a line above or below matching pattern?

I couldn't figure out how to use sed or any other shell to do the following. Can anyone help? Thanks. If seeing a string (e.g., TODAY) in the line, replace a string in the line above (e.g, replace "Raining" with "Sunny") and replace a string in the line below (e.g., replace "Reading" with... (7 Replies)
Discussion started by: sprinner
7 Replies

4. Shell Programming and Scripting

matching pattern to end of line

I have the following code and want to get only the comments. Ideally I would like to replace the characters to the left of the first '!' in the line with blanks. real, dimension(:), allocatable :: ft ! stores a single trace real, dimension(:), allocatable :: tr ! stores a single... (8 Replies)
Discussion started by: kristinu
8 Replies

5. Shell Programming and Scripting

Duplicate line removal matching some columns only

I'm looking to remove duplicate rows from a CSV file with a twist. The first row is a header. There are 31 columns. I want to remove duplicates when the first 29 rows are identical ignoring row 30 and 31 BUT the duplicate that is kept should have the shortest total character length in rows 30... (6 Replies)
Discussion started by: Michael Stora
6 Replies

6. Shell Programming and Scripting

awk to copy previous line matching a particular columns

Hello Help, 2356798 7689867 999 000 123678 20385907 9797 666 17978975 87468976 968978 98798 I am trying to have out put which actually look for the third column value of 9797 and then it insert line there after with first, second column value exactly as the previous line and replace the third... (3 Replies)
Discussion started by: Indra2011
3 Replies

7. Shell Programming and Scripting

Sed: printing lines AFTER pattern matching EXCLUDING the line containing the pattern

'Hi I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match. Which option is to be used to exclude the line containing the pattern? sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies

8. Shell Programming and Scripting

Fetching a line matching a pattern

Hi Gurus, I have a file as follows (Sample shown below but the list is very huge) SCHEDULE WS1#JS1 RUNCYCLE1 : WS1#JOB1 WS1#JOB2 FOLLOWS JOB1 END SCHEDULE WS2#JS1 RUNCYCLE2 : WS1#JOB3 WS1#JOB1 FOLLOWS JOB3 WS2#JOB1 (10 Replies)
Discussion started by: jayadanabalan
10 Replies

9. UNIX for Dummies Questions & Answers

Print only the duplicate line only with matching columns

Hi There, I have an I/P which looks like -- 1 2 3 4 5 1 2 3 4 6 4 7 8 9 9 5 6 7 8 9 I would like O/P to be --- 1 2 3 4 5 1 2 3 4 6 So, printing only the consecutive lines where $1,$2,$3,$4 are matching. Is there any command to do this or small awk script? Thanks, (12 Replies)
Discussion started by: Indra2011
12 Replies

10. Shell Programming and Scripting

How do I select certain columns with matching pattern and rest of the lines?

I want to select 2nd, 3rd columns if line has "key3" and print rest of the lines as is. # This is my sample input key1="val1" key2="val2" key3="val3" key4="val4" some text some text some text some text key1="val1" key2="val2" key3="val3" key4="val4" some text some text some text some... (3 Replies)
Discussion started by: kchinnam
3 Replies
xlsfonts(1)						      General Commands Manual						       xlsfonts(1)

NAME
xlsfonts - server font list displayer for X SYNOPSIS
xlsfonts [-display host:dpy] [-l] [-ll] [-lll] [-m] [-C] [-1] [-w width] [-n columns] [-u] [-o] [-fn pattern] DESCRIPTION
xlsfonts lists the fonts that match the given pattern. The wildcard character "*" may be used to match any sequence of characters (includ- ing none), and "?" to match any single character. If no pattern is given, "*" is assumed. The "*" and "?" characters must be quoted to prevent them from being expanded by the shell. OPTIONS
-display host:dpy This option specifies the X server to contact. -d host:dpy Same as -display host:dpy. -l Lists some attributes of the font on one line in addition to its name. -ll Lists font properties in addition to -l output. -lll Lists character metrics in addition to -ll output. -m This option indicates that long listings should also print the minimum and maximum bounds of each font. -C This option indicates that listings should use multiple columns. This is the same as -n 0. -1 This option indicates that listings should use a single column. This is the same as -n 1. -w width This option specifies the width in characters that should be used in figuring out how many columns to print. The default is 79. -n columns This option specifies the number of columns to use in displaying the output. By default, it will attempt to fit as many columns of font names into the number of character specified by -w width. -u This option indicates that the output should be left unsorted. -o This option indicates that xlsfonts should do an OpenFont (and QueryFont, if appropriate) rather than a ListFonts. This is useful if ListFonts or ListFontsWithInfo fail to list a known font (as is the case with some scaled font systems). -fn pattern This option specifies the font name pattern to match. SEE ALSO
X(7), Xserver(1), xset(1), xfd(1), X Logical Font Description Conventions ENVIRONMENT
DISPLAY DISPLAY must be set to get the default host and display to use. BUGS
Doing ``xlsfonts -l'' can tie up your server for a very long time. This is really a bug with single-threaded non-preemptable servers, not with this program. AUTHOR
Mark Lillibridge Jim Fulton Phil Karlton Roland Mainz X Version 11 xlsfonts 1.0.4 xlsfonts(1)
All times are GMT -4. The time now is 08:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy