Sponsored Content
Top Forums Shell Programming and Scripting Searching for multiple patterns in files Post 302398651 by bornon2303 on Thursday 25th of February 2010 07:02:05 AM
Old 02-25-2010
At our installation, the -f option is not working.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Searching multiple files with multiple expressions

I am using a DEC ALPHA running Digital UNIX (formly DEC OSF/1) and ksh. I have a directory with hundreds of files that only share the extension .rpt. I would like to search that directory based on serial number and operation number and only files that meet both requirements to be printed out. I... (6 Replies)
Discussion started by: Anahka
6 Replies

2. Shell Programming and Scripting

Script for searching a pattern in 5 files and deleting the patterns given

Hi All, I have written the below script that searches for the pattern in a file and delete them if present. please can some one have a look and suggest the changes in the script. #!bin/sh # The pattern that user want to add to the files echo "Enter the pattern of the redirect" read... (4 Replies)
Discussion started by: Shazin
4 Replies

3. Shell Programming and Scripting

Searching patterns in 1 file and deleting all lines with those patterns in 2nd file

Hi Gurus, I have a file say for ex. file1 which has 3500 lines in it which are different account numbers and another file (file2) which has 230000 lines in it. I want to read all the lines in file1 and delete all those lines from file2 which has that same pattern as in file1. I am not quite... (4 Replies)
Discussion started by: toms
4 Replies

4. Shell Programming and Scripting

grep multiple patterns in number of files

Hi, I want to list the files containing a no of pattern like for single string i can use grep -l "string" * This command will enlist the files containg this string. Similarly i would like to use for multiple string. I like to enlist file names having string1 and string 2 Can... (3 Replies)
Discussion started by: vikash_k
3 Replies

5. Shell Programming and Scripting

Searching for multiple patterns in a file

Hi All, I have a file in which i have to search for a pattern from the beginning of the file and if the pattern is found , then i have to perform a reverse search from that line to the beginning of the file to get the first occurrence of another pattern. sample input file hey what are you... (8 Replies)
Discussion started by: Kesavan
8 Replies

6. Shell Programming and Scripting

Search multiple patterns in multiple files

Hi, I have to write one script that has to search a list of numbers in certain zipped files. For eg. one file file1.txt contains the numbers. File1.txt contains 5,00,000 numbers and I have to search each number in zipped files(The number of zipped files are around 1000 each file is 5 MB) I have... (10 Replies)
Discussion started by: vsachan
10 Replies

7. Shell Programming and Scripting

searching multiple patterns in perl

Hi, I have code like: Output it is comming as: Rels: WM2 Rels: WG2 Rels: 5 - pre/prods.pl Rels: 6 Rels: 7 Rels: 8 Rels: 10 Rels: Int But i want only "Rels: 5" pattern Just above "- pre/prods.pl". By... (7 Replies)
Discussion started by: Anjan1
7 Replies

8. Shell Programming and Scripting

Searching multiple patterns using awk

Hello, I have the following input file: qh1adm 20130710111201 : tp import all QH1 u6 -Dsourcesystems=BFI,EBJ qh1adm 20130711151154 : tp import all QH1 u6 -Dsourcesystems=BFI,EBJ qx1adm 20130711151154 : tp count QX1 u6 -Dsourcesystems=B17,E17,EE7 qh1adm 20130711151155 : tp import all... (7 Replies)
Discussion started by: kcboy
7 Replies

9. UNIX for Dummies Questions & Answers

[Solved] List Files With Multiple Name Patterns

Hi, We have created a script that would accept the an indicator as a parameter and archive files present in a directory. The indicator would drive what the name pattern of the files to be archived should be. If the indicator is 1, then the pattern to look out for is FACT*. If the indicator is... (2 Replies)
Discussion started by: jerome_rajan
2 Replies

10. Shell Programming and Scripting

Searching multiple patterns and construct SQL

Hello, I have attached 2 files 1) Original_table_definition.txt => which has definition of 3 tables 2) describe_table_output.txt => which has again 3 tables definition gotten thorugh doing a show table or describe table way. Now difference between 3 tables are that tablea has no... (2 Replies)
Discussion started by: nv186000
2 Replies
srchtxt(1)							   User Commands							srchtxt(1)

NAME
srchtxt - display contents of, or search for a text string in, message data bases SYNOPSIS
srchtxt [-s] [-l locale] [ -m msgfile ,...] [text] DESCRIPTION
The srchtxt utility is used to display all the text strings in message data bases, or to search for a text string in message data bases (see mkmsgs(1)). These data bases are files in the directory /usr/lib/locale/locale/LC_MESSAGES (see setlocale(3C)), unless a file name given with the -m option contains a /. The directory locale can be viewed as the name of the language in which the text strings are writ- ten. If the -l option is not specified, the files accessed will be determined by the value of the environment variable LC_MESSAGES. If LC_MESSAGES is not set, the files accessed will be determined by the value of the environment variable LANG. If LANG is not set, the files accessed will be in the directory /usr/lib/locale//C/LC_MESSAGES , which contains default strings. If no text argument is present, then all the text strings in the files accessed will be displayed. If the -s option is not specified, the displayed text is prefixed by message sequence numbers. The message sequence numbers are enclosed in angle brackets: <msgfile:msgnum>. msgfile name of the file where the displayed text occurred msgnum sequence number in msgfile where the displayed text occurred This display is in the format used by gettxt(1) and gettxt(3C). OPTIONS
-s Suppress printing of the message sequence numbers of the messages being displayed. -l locale Access files in the directory /usr/lib/locale/locale/LC_MESSAGES. If -m msgfile is also supplied, lOCALE is ignored for msgfiles containing a /. -m msgfile Access files specified by one or more msgfiles. If msgfile contains a / character, then msgfile is interpreted as a path- name; otherwise, it will be assumed to be in the directory determined as described above. To specify more than one msgfile, separate the file names using commas. text Search for the text string specified by text and display each one that matches. text can take the form of a regular expres- sion; see regexp(5). EXAMPLES
Example 1: Using srchtxt If message files have been installed in a locale named french by using mkmsgs(1), then you could display the entire set of text strings in the french locale (/usr/lib/locale/french/LC_MESSAGES/* ) by typing: example% srchtxt -l french Example 2: Using srchtxt If a set of error messages associated with the operating system have been installed in the file UX in the french locale (/usr/lib/locale/french/LC_MESSAGE/UX ), then, using the value of the LANG environment variable to determine the locale to be searched, you could search that file in that locale for all error messages dealing with files by typing: example% setenv LANG=french; export LANG example% srchtxt -m UX "[Ff]ichier" If /usr/lib/locale/french/LC_MESSAGES/UX contained the following strings: Erreur E/S Liste d'arguments trop longue Fichier inexistant Argument invalide Trop de fichiers ouverts Fichier trop long Trop de liens Argument hors du domaine Identificateur supprim Etreinte fatale . . . then the following strings would be displayed: <UX:3>Fichier inexistant <UX:5>Trop de fichiers ouverts <UX:6>Fichier trop long Example 3: Using srchtxt If a set of error messages associated with the operating system have been installed in the file UX and a set of error messages associated with the INGRESS data base product have been installed in the file ingress, both in the german locale, then you could search for the pat- tern [Dd]atei in both the files UX and ingress in the german locale by typing: example% srchtxt -l german -m UX,ingress "[Dd]atei" ENVIRONMENT VARIABLES
See environ(5) for a description of the LC_CTYPE environment variable that affects the execution of srchtxt. FILES
/usr/lib/locale/C/LC_MESSAGES/* default files created by mkmsgs(1) /usr/lib/locale/locale/LC_MESSAGES/* message files created by mkmsgs(1) ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Availability |SUNWloc | +-----------------------------+-----------------------------+ SEE ALSO
exstr(1), gettxt(1), locale(1), mkmsgs(1), gettxt(3C), setlocale(3C), attributes(5), environ(5), locale(5), regexp(5) DIAGNOSTICS
The error messages produced by srchtxt are intended to be self-explanatory. They indicate an error in the command line or errors encoun- tered while searching for a particular locale and/or message file. SunOS 5.10 20 Dec 1996 srchtxt(1)
All times are GMT -4. The time now is 01:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy