Reading from files and searching them


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Reading from files and searching them
# 1  
Old 05-02-2002
Data Reading from files and searching them

I need to have a script that can read words from one file, read files from another file and than searches for the words in the files.
so like
sh searchwords words files.
# 2  
Old 05-02-2002
This sounds like a homework problem. Please read the forum rules regarding homework.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Searching files

i want to search a file bt it not happening i m using #!bin/bash read file if (-e "$file") then echo "asfsafafa" else echo "NO SUCH FILE" fi ....error ./VMC.sh: line 5: : command not found NO SUCH FILE ;;;;;;;;;; its giving correctly no such file found but whats is command not found. (7 Replies)
Discussion started by: console
7 Replies

2. Shell Programming and Scripting

Searching across multiple files if pattern is available in all files searched

I have a list of pattern in a file, I want each of these pattern been searched from 4 files. I was wondering this can be done in SED / AWK. say my 4 files to be searched are > cat f1 abc/x(12) 1 abc/x 3 cde 2 zzz 3 fdf 4 > cat f2 fdf 4 cde 3 abc 2... (6 Replies)
Discussion started by: novice_man
6 Replies

3. Shell Programming and Scripting

Searching for Log / Bad file and Reading and writing to a flat file

Need to develop a unix shell script for the below requirement and I need your assistance: 1) search for file.log and file.bad file in a directory and read them 2) pull out "Load_Start_Time", "Data_File_Name", "Error_Type" from log file 4) concatinate each row from bad file as... (3 Replies)
Discussion started by: mlpathir
3 Replies

4. UNIX for Advanced & Expert Users

Searching for files

Hi, I have the following command to list files beginning with a specific name and containing some text... find . -type f -name "dm_merge_domain_adm*" -exec grep -il "Error Message:" '{}' \; -print|xargs ls -ltr It works fine, but seems to list two of each file, when they only exist once...any... (1 Reply)
Discussion started by: chrislluff1976
1 Replies

5. Shell Programming and Scripting

Files searching

I have a list of files in directory and i should write a script if any of these files contains words given in a text file test.txt. the words can be case ignored and word should match. The output should be the name of the directory in which the file is present followed by list of file names Eg:... (1 Reply)
Discussion started by: kinny
1 Replies

6. Shell Programming and Scripting

Reading an Input file and searching for occurrences WIHOUT SED or AWK

Hi people. I am new to shell scripting, so I need a little help. I want to create a script named that takes an argument as a file, Read the input file and look for occurrences of the current username (say abc.xyz) who is executing the script. On finding an occurrence of the username take that line... (2 Replies)
Discussion started by: kartikkumar84@g
2 Replies

7. UNIX for Advanced & Expert Users

Searching Files

Hi, I have a file /db01/dat/march 2006/7001DW06.03B Please note, between "march 2006" there is a space/tab. While running the following script, it identifies /db01/dat/march ----> as first file 2006/7001DW06.03B ---> as second file. SRC_PATH = /db01/dat SEARCH_FILENAME =... (12 Replies)
Discussion started by: ronald_brayan
12 Replies

8. Shell Programming and Scripting

reading and searching xml element text in script

well i have this xml file here: this file is called filereader.xml <?xml version="1.0" encoding="UTF-8"?> <file> <file1> <filecopy>/new/test/thefile.txt</filecopy> <filecopy>/new/test/thefile2.ppt</filecopy> </file1> </file> i need to write the script that search for the Bold text... (2 Replies)
Discussion started by: forevercalz
2 Replies

9. Shell Programming and Scripting

reading and searching xml element text in script

well i have this xml file here: this file is called filereader.xml <?xml version="1.0" encoding="UTF-8"?> <file> <file1> <filecopy>thefile.txt</filecopy> <filecopy>thefile2.ppt</filecopy> </file1> </file> hi..i got this problem....hmm how do i write a... (6 Replies)
Discussion started by: forevercalz
6 Replies

10. UNIX for Dummies Questions & Answers

Searching files..?

hi there can anyone tell me how to search and copy files under unix? im writing shell scripts with 'vi' and 'pico' something like read directoryName if then echo Copying the files copy those *.src files to sub1(another directory) using cp else ... (4 Replies)
Discussion started by: nickaren
4 Replies
Login or Register to Ask a Question