Sponsored Content
Full Discussion: Grep Multiple Strings
Top Forums Shell Programming and Scripting Grep Multiple Strings Post 302328451 by durgaprasad on Wednesday 24th of June 2009 10:38:18 AM
Old 06-24-2009
i have multiple records matching with the strings given,i want only 1 record matching.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Efficient way to grep multiple strings

I have a script which searches a huge log file for the existence of a specified string and if the string is not present i receive an alert mail. Here's an extract: STRING=$(grep 'warning' logfile | tail -1 | wc -l) if (( ${STRING} > 0 )); then print -- "---- Warning etc.... (3 Replies)
Discussion started by: Moxy
3 Replies

2. Shell Programming and Scripting

Count occurance of multiple strings using grep command

How to grep multiple string occurance in input file using single grep command? I have below input file with many IDP, RRBE messages. Out put should have count of each messages. I have used below command but it is not working grep -cH "(sent IDP Request)(Recv RRBCSM)" *.txt ... (5 Replies)
Discussion started by: sushmab82
5 Replies

3. Shell Programming and Scripting

How to get filename from the fullpath and how to grep multiple strings

Hi, New to shell scripting.... I have log file content as below: I have to count the number of occurences of ERROR or INFO Messages. So, I cut 5 th column and uniquly sorted and redirected it to new.txt file. But I want copy to S*/Filename and T*/Filename of respective ERROR or INFO... (5 Replies)
Discussion started by: Shirisha
5 Replies

4. UNIX for Dummies Questions & Answers

grep command to find multiple strings in multiple lines in a file.

I want to search files (basically .cc files) in /xx folder and subfolders. Those files (*.cc files) must contain #include "header.h" AND x() function. I am writing it another way to make it clear, I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Discussion started by: ritikaSharma
2 Replies

5. UNIX for Dummies Questions & Answers

Grep multiple strings in multiple files using single command

Hi, I will use below command for grep single string ("osuser" is search string) ex: find . -type f | xarg grep -il osuser but i have one more string "v$session" here i want to grep in which file these two strings are present. any help is appreciated, Thanks in advance. Gagan (2 Replies)
Discussion started by: gagan4599
2 Replies

6. Shell Programming and Scripting

Grep multiple strings in multiple files

Hi, every one! I have a file with multiple strings. file1 ATQRGNE ASQGVKFTE ASSQYRDRGGLET SPEQGARSDE ASSRDFTDT ASSYSGGYE ASSYTRLWNTGE ASQGHNTD PSLGGGNQPQH SLDRDSYNEQF I want to grep each string in hundreds of files in the same directory, further, I want to find out the string... (7 Replies)
Discussion started by: xshang
7 Replies

7. Shell Programming and Scripting

Can't grep multiple strings

I have a script that periodically checks the Apache error_log to search for a specific error that causes it to hand and, if found, it restarts the service. I recently found another error that forces it to hand and won't serve pages until it is reset. What I'm trying to do is to get the script to... (3 Replies)
Discussion started by: cfjohnsn
3 Replies

8. Shell Programming and Scripting

Whether we can search multiple strings using or in grep -F

Hi, Whether we can search multiple strings using or in grep -F In Generally, grep -F "string1" "filename.txt" How to search for multiple string using grep -F as we using grep grep "string1\|string2" "filename.txt" Regards, Nanthagopal A (10 Replies)
Discussion started by: nanthagopal
10 Replies

9. Shell Programming and Scripting

Grep multiple strings in a file

Consider i have the below data in my log file. i want to grep using "Monday" and "Working" So the only output i expect is Can you help me with the grep query for Sun Sparc ? Usage: grep -hblcnsviw pattern file . . . (8 Replies)
Discussion started by: mohtashims
8 Replies

10. Shell Programming and Scripting

Grep for text between twp strings for multiple occurances.

I need to get text between two strings <app-deployment file=" and </app-deployment> as it appears more than once in the file then how can i store the text between each occurrence in a separate file ? Thus, i need the below to go in found1.tmp and the below to go in found2.tmp ... (8 Replies)
Discussion started by: mohtashims
8 Replies
XmStringTableUnparse(library call)										XmStringTableUnparse(library call)

NAME
XmStringTableUnparse -- A convenience function that converts a table of compound strings to an array of text SYNOPSIS
#include <Xm/Xm.h> XtPointer * XmStringTableUnparse( XmStringTable table, Cardinal count, XmStringTag tag, XmTextType tag_type, XmTextType output_type, XmParseTable parse, Cardinal parse_count, XmParseModel parse_model); DESCRIPTION
XmStringTableUnparse takes an array of compound strings, allocates a string array for the type of characters determined by type with an equal number of slots, calls XmStringUnparse on each compound string in table, and inserts the resulting string in the corresponding slot in the array. table Specifies an XmStringTable containing the compound string to be converted. count Specifies the number of compound strings in table. tag Specifies the tag to be used in matching with text segments. The two types of tag types are XmFONTLIST_DEFAULT_TAG and _MOTIF_DEFAULT_LOCALE. Only segments tagged with tag will be returned. If tag is NULL, all segments will be matched. tag_type Specifies the type of tag to be searched for. These types include XmMULTIBYTE_TEXT, XmWIDECHAR_TEXT, and XmCHARSET_TEXT. output_type Specifies the type of text to be generated. These types include XmMULTIBYTE_TEXT, XmWIDECHAR_TEXT, and XmCHARSET_TEXT. parse Specifies the parse table to be used. parse_count Specifies the number of items in parse. parse_model Specifies which non-text components to be considered in matching in parse_table. Possible values are: XmOUTPUT_ALL Puts out all matching components. XmOUTPUT_BETWEEN Puts out only those matching components that are between two matching text components. XmOUTPUT_BEGINNING Puts out only those matching components that are at the beginning of a matching text component. XmOUTPUT_END Puts out only those matching components that are at the end of a matching text component. XmOUTPUT_BOTH Puts out only those matching components that are at the beginning or end of a matching text component. RETURN
Returns an allocated array of allocated strings. The application is responsible for managing the allocated space. The application can recover the allocated strings space by calling XtFree count times (that is, one time for each allocated string). The application can then recover the allocated array by calling XtFree on the allocated array itself. RELATED
XmStringTab. XmStringTableUnparse(library call)
All times are GMT -4. The time now is 09:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy