12-10-2009
grep for certain files using a file as input to grep and then move
Hi All, I need to grep few files which has words like the below in the file name , which i want to put it in a file and and grep for the files which contain these names and move it to a new directory ,
full file name -C20091210.1000-20091210.1100_SMGBSC3:1000 ,C20091210.1000-20091210.1100_LUD2:1000 ,
input file for grep SMGBSC3 LUD2 KSLI JIND ,
any help would be apprecaited .thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Here is an answer rather than a question that I thought I would share.
In my first attempt, I was using grep to find a list from file.1 within another file, file.2 which I then needed to paste the output from file.3 to file.1 in the same order. However, the results weren't what I wanted.
At... (2 Replies)
Discussion started by: Kelam_Magnus
2 Replies
2. Shell Programming and Scripting
Hi, i have number of files in a directory to be processed. the problem is some of the files does not have a header and the process is giving an error of no header found.
example of good file :
file1
HDR|20080803233401
record 1
record 2
TRA|2
example of a bad file in the same dir
... (6 Replies)
Discussion started by: sitaldip
6 Replies
3. Shell Programming and Scripting
Hello, this is probably another really simple tasks for most of you gurus, however I am trying to make a script which takes an input, greps a specific file for that input, prints back to screen the results (which are directory names) and then be able to use the directory names to move files.... (1 Reply)
Discussion started by: JayC89
1 Replies
4. UNIX for Dummies Questions & Answers
I have a folder with about 4000 files in it. I need to extract the files that contain a certain line of text to another directory.
for example files with 'ns1.biz.rr.com' need to be extracted to the directory above or some other directory.
I tried using the following but was not successful. (6 Replies)
Discussion started by: spartan22
6 Replies
5. Shell Programming and Scripting
I'm having problems since few days ago, and i'm not able to make it works with a simple awk+grep script (or other way to do this).
For example, i have a input file1.txt:
cat inputfile1.txt
218299910417
1172051195
1172070231
1172073514
1183135117
1183135118
1183135119
1281440202
... (3 Replies)
Discussion started by: poliver
3 Replies
6. Shell Programming and Scripting
I am looking for advice on how to write a script that will rename and/or move files to a different directory based upon the results of a grep.
Let's say I have ten files in a directory. Some of them - not all - contain the text 'HELLO'. I would like to be able to grep the files for that text,... (3 Replies)
Discussion started by: rjhjr64
3 Replies
7. Shell Programming and Scripting
I have two files: usednaslist & naslist
Using RHEL5
usednaslist
>filera:/vol/EQIMS/build
>filera:/vol/iquad_dev/FAST_dev
naslist
>server12 SunOS filera:/vol/EQIMS/build /users/uxsrvlogs
>servers3 SunOS filera:/vol/iquad_dev/FAST_dev /mnt
>server4 SunOS ... (2 Replies)
Discussion started by: nitrobass24
2 Replies
8. Shell Programming and Scripting
I have been struggling to grep a file of NGrams (basically clusters of consonants or Consonant and Vowel) acting as a pattern file from an Input file which contains a long list of words, one word per line. The script would do two things:
Firstly read a text pattern from a large file of such... (5 Replies)
Discussion started by: gimley
5 Replies
9. UNIX for Beginners Questions & Answers
When I use the following grep command with options -F and -f, its just displaying the text related to only the last pattern.
Command: $ grep -f pattern_file.txt input_file.txt
Output: doc-C2-16354
Even the following command yields the same output:
Command: $ grep -Ff pattern_file.txt... (6 Replies)
Discussion started by: nsai
6 Replies
10. Programming
Hi Experts,
I am writing a python script to grep string from file and display output in csv file as in attached screenshot
https://drive.google.com/file/d/1gfUUdfmQma33tz65NskThYDhkZUGQO0H/view
Input file(result_EPFT_config_device)
Below is the python script i have prepared as of... (1 Reply)
Discussion started by: as7951
1 Replies