Sponsored Content
Top Forums UNIX for Dummies Questions & Answers print multiple lines from text file based on pattern list Post 302555418 by Corona688 on Wednesday 14th of September 2011 04:43:58 PM
Old 09-14-2011
What's your system?

Code:
grep -F -f patternfile < logfile

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Merge lines in text file based on pattern

Hello, I have searched forum trying to find a solution to my problem, but could not find anything or I did not understand the examples.... I should say, I am very inexperienced with text processing. I have a text file with approx 60k lines in it. I need to merge lines based on the number... (8 Replies)
Discussion started by: Bertik
8 Replies

2. Shell Programming and Scripting

Awk: print lines with one of multiple pattern in the same field (column)

Hi all, I am new to using awk and am quickly discovering what a powerful pattern-recognition tool it is. However, I have what seems like a fairly basic task that I just can't figure out how to perform in one line. I want awk to find and print all the lines in which one of multiple patterns (e.g.... (8 Replies)
Discussion started by: elgo4
8 Replies

3. Shell Programming and Scripting

Split a text file into multiple pages based on pattern

Hi, I have a text file (attached the sample). I have also, attached the way the way the files need to be split. We get this file, that will either have 24 Jurisdictions, or will miss some and retain some. Like in the attached sample file, there are only Jurisdictions 03,11,14,15, 20 and 30.... (3 Replies)
Discussion started by: ebsus
3 Replies

4. 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

5. Shell Programming and Scripting

Removing multiple lines from input file, if multiple lines match a pattern.

GM, I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed. I am assuming that sed, awk or even perl could do what I need. I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies

6. Shell Programming and Scripting

awk to print lines based on text in field and value in two additional fields

In the awk below I am trying to print the entire line, along with the header row, if $2 is SNV or MNV or INDEL. If that condition is met or is true, and $3 is less than or equal to 0.05, then in $7 the sub pattern :GMAF= is found and the value after the = sign is checked. If that value is less than... (0 Replies)
Discussion started by: cmccabe
0 Replies

7. UNIX for Beginners Questions & Answers

UNIX script to append multiple text files into one file based on pattern present in filaname

Hi All-I am new to Unix , I need to write a script. Can someone help me with a requirement where I have list of files in a directory, I want to Merge the files if a pattern of string matches in filenames? AAAL_555A_ORANGE1_F190404.TXT AAAL_555A_ORANGE2_F190404.TXT AAAL_555A_ORANGE3_F190404.TXT... (6 Replies)
Discussion started by: Shankar455
6 Replies

8. Shell Programming and Scripting

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

hi all, trying this using shell/bash with sed/awk/grep I have two files, one containing one column, the other containing multiple columns (comma delimited). file1.txt abc12345 def12345 ghi54321 ... file2.txt abc1,text1,texta abc,text2,textb def123,text3,textc gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies

9. UNIX for Beginners Questions & Answers

Reading a file line by line and print required lines based on pattern

Hi All, i want to write a shell script read below file line by line and want to exclude the lines which contains empty value for MOUNTPOINT field. i am using centos 7 Operating system. want to read below file. # cat /tmp/d5 NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root"... (4 Replies)
Discussion started by: balu1234
4 Replies
XmbDrawText()															     XmbDrawText()

Name
  XmbDrawText - draw internationalized multi-byte text using multiple font sets.

Synopsis
  void XmbDrawText(display, drawable, gc, x, y, items, nitems)
	Display *display;
	Drawable drawable;
	GC gc;
	int x, y;
	XmbTextItem *items;
	int nitems;

Arguments
  display   Specifies the connection to the X server.

  drawable  Specifies the drawable.

  gc	    Specifies the graphics context.

  x, y	    Specifies the starting position and baseline of the text, relative to the origin of the specified drawable.

  items     Specifies an array of text items.

  nitems    Specifies the number of text items in the array.

Description
  XmbDrawText() allows complex spacing and font set shifts between internationalized multi-byte text strings.  Each text item is processed in
  turn, with the origin of a text element advanced in the primary draw direction by the escapement of the previous text item.	A  text  item
  delta  specifies an additional escapement of the text item drawing origin in the primary draw direction.  A font_set member other than None
  in an item causes the font set to be used for this and subsequent text items in the items list.  Leading text items  with  font_set  member
  set to None will not be drawn.

  XmbDrawText()  does  not perform any context-dependent rendering between text segments.  Clients may compute the drawing metrics by passing
  each text segment to XmbTextExtents() or XmbTextPerCharExtents().  When the XFontSet has missing charsets, each  unavailable	character  is
  drawn with the default string returned by XCreateFontSet().  The behavior for an invalid codepoint is undefined.

  XmbDrawText()  draws	with  fonts  from the font sets of the items list rather than the font of the GC.  For this reason, it may modify the
  font value of the GC.  Except for the font, it uses the same GC components as its pre-X11R5 analog XDrawText().

Structures
  The XmbTextItem structure contains:

     typedef struct {
	    char *chars;	  /* pointer to string */
	    int nchars; 	  /* number of characters */
	    int delta;		  /* pixel delta between strings */
	    XFontSet font_set;	  /* fonts, None means don't change */
     } XmbTextItem;

See Also
  XDrawImageString(), XDrawString(), XDrawText(), XmbDrawImageString(), XmbDrawString(), XwcDrawText().

Xlib - Internationalized Text													     XmbDrawText()
All times are GMT -4. The time now is 02:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy