Sponsored Content
Top Forums UNIX for Dummies Questions & Answers script to search patterns inside list of files Post 302463831 by dr46014 on Monday 18th of October 2010 02:22:37 PM
Old 10-18-2010
script to search patterns inside list of files

>testfile

Code:
while read x
do
if [ `grep -c abc.dml $x` -ne 0 ] then
echo $x >> testfile
else
fi
if [ `grep -c xyz.dml $x` -ne 0 ] then
echo $x >> testfile
else
fi
done < list_of_files

is there any efficient way to search abc.dml and xyz.dml ?

Last edited by Scott; 10-18-2010 at 03:56 PM.. Reason: Code tags, please...
 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

how to search files efficiently using patterns

hi friens, :) if i need to find files with extension .c++,.C++,.cpp,.Cpp,.CPp,.cPP,.CpP,.cpP,.c,.C wat is the pattern for finding them :confused: (2 Replies)
Discussion started by: arunsubbhian
2 Replies

2. Shell Programming and Scripting

Using a script variable in awk search patterns

Hi all, In a script like : job_date=.... ls -l 2>/dev/null | awk -v var =$job_date ' /Name\.Version\.+\.xml$/ { How can i include a script variable job_date store in "var" in the pattern "/Name\.Version\.+\.xml$/" Thanks in advance (12 Replies)
Discussion started by: abhinav192
12 Replies

3. UNIX for Advanced & Expert Users

Best way to search for patterns in huge text files

I have the following situation: a text file with 50000 string patterns: abc2344536 gvk6575556 klo6575556 .... and 3 text files each with more than 1 million lines: ... 000000 abc2344536 46575 0000 000000 abc2344536 46575 4444 000000 abc2344555 46575 1234 ... I... (8 Replies)
Discussion started by: andy2000
8 Replies

4. Shell Programming and Scripting

to read two files, search for patterns and store the output in third file

hello i have two files temp.txt and temp_unique.text the second file consists the unique fields from the temp.txt file the strings stored are in the following form 4,4 17,12 15,65 4,4 14,41 15,65 65,89 1254,1298i'm able to run the following script to get the total count of a... (3 Replies)
Discussion started by: vaibhavkorde
3 Replies

5. SuSE

Search all files based on first and in all listed files search the second patterns

Hello Linux Masters, I am not a linux expert therefore i need help from linux gurus. Well i have a requirement where i need to search all files based on first patterns and after seraching all files then serach second pattern in all files which i have extracted based on first pattern.... (1 Reply)
Discussion started by: Black-Linux
1 Replies

6. Programming

Is it possible to change search inside .pdf or .doc files?

the titele was wrong ... the true one is: Is it possible to search words inside .pdf or .doc files? is it possible if i changed the word into binary combination:eek:? and this way is super too hyper huge of greatest codes i ever seen:D to read only 1 word so is there any other ways:confused:? ... (1 Reply)
Discussion started by: fwrlfo
1 Replies

7. Shell Programming and Scripting

Search for patterns in thousands of files

Hi All, I want to search for a certain string in thousands of files and these files are distributed over different directories created daily. For that I created a small script in bash but while running it I am getting the below error: /ms.sh: xrealloc: subst.c:5173: cannot allocate... (17 Replies)
Discussion started by: danish0909
17 Replies

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

9. Shell Programming and Scripting

Search and replace multiple patterns in a particular column only - efficient script

Hi Bigshots, I have a pattern file with two columns. I have another data file. If column 1 in the pattern file appears as the 4th column in the data file, I need to replace it (4th column of data file) with column 2 of the pattern file. If the pattern is found in any other column, it should not... (6 Replies)
Discussion started by: ss112233
6 Replies

10. Programming

Search or find a element inside list python

I have a list as follows: From this i need to grep the element using keyword as "primary" and return output as 12:13-internet-wifi-primary i used as follows if (i <= (len(system_info))): ss = system_info print... (5 Replies)
Discussion started by: Priya Amaresh
5 Replies
GPIV_PROCESS-CHAIN(1)					      General Commands Manual					     GPIV_PROCESS-CHAIN(1)

NAME
gpiv_process-chain - Processes a pipe of Gpiv-tool command's. SYNOPSIS
gpiv_process-chain [-af string] [-h | -help] [-n | -none] [-c | -clean] [-fik] [-p | -print] [-pf -string] [-proc_*] [-t format] [-v | -version] filename DESCRIPTION
Gpiv_process-chain processes a pipe of gpiv commands. Image evaluation/interrogation with gpiv_rr is always included, image recording may be prepended before interrogation, validation and post-processes may be appended to the chain. The filename represents the name of the image to be evaluated. The file naming conventions are idententic to the output of the individual Gpivtools programs: in case the output are (validated/scaled) PIV data, the data will be directed to filename.piv, with -proc_vorty the output will be called filename.vor, with -proc_nstrain the output will be called filename.nstr and, finally, with with -proc_sstrain the output will be called filename.sstr. This program does not use the parameter resources from libgpiv. Options -af string Append string to file-base name. -h | --help On-line help. -n | --none Suppresses real execution. -c | -clean Cleans up: removes raw image data and header. -fik Use fi-keyline for filtering gpiv parms from README. -p | --print Prints parameters, command line options and input and output filenames to stdout. -pf string Prepend string to file-base name. -proc_* Defines processes to be included in the chain. * is substituted by: imgrec, valid, scale, manipiv, flipx, flipy, revert, rot90, rot180 and vorty or nstrain or sstrain. Vorty, nstrain and sstrain may not be used in combination with -t gpi. -t format Image type or format: hdf (.hdf), dav (.IMG) or a type as defined by ImageMagic's convert. Default is raw binary image (.r). -v | --version Prints version information to standard output, then exits successfully. filename Input image filename. Format may be: .r, .hdf (hdf), .IMG (davis), .png, .gif, .tif or.bmp. EXAMPLES
invoking: 'gpiv_process-chain -proc_valid -proc_scale testfile.png' will actually perform: gpiv_rr < image.png | gpiv_errvec > testfile.piv invoking: 'gpiv_process-chain -proc_imgrec -proc_valid -proc_scale testfile.png' will do: gpiv_recimg | gpiv_rr | gpiv_errvec | gpiv_scale > testfile.piv SEE ALSO
gpivtools AUTHOR
Gerber Van der Graaf 19 Januari 2005 GPIV_PROCESS-CHAIN(1)
All times are GMT -4. The time now is 02:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy