finding matches between multiple files from different directories
Hi all...
Can somebody pls help me with this...
I have a directory (dir1) which has many subdirectories(vr001,vr002,vr003..) with each subdir containing similar text file(say ras.txt).
I have another directory(dir2) which has again got some subdir(vr001c,vr002c,vr003c..) with each subdir containing three text files(r1.txt,r2.txt,r3.txt).
Now i want to do something like this for all the subdirectories in dir1:
(i do not know if its right!!)
I have two questions:
1)How to find the matched lines in the two text files
2) How to pipe the corresponding output to a new file(eg. newr1.txt,newr2.txt,newr3.txt) for all the subdirectories in dir1.
NOTE: the names of the subdirectories in dir1 and dir2 are similar(eg: vr001 and vr001clusters)
Pls help me!!
Sample content of files:
ras.txt
r1.txt
Moderator's Comments:
Please use code tags! Also please do not overly use font formattings, thanks. You also got a PM with an explanation.
Last edited by zaxxon; 03-29-2012 at 04:15 AM..
Reason: code tags, font formattings
i need to find a portable way to go through multiple directories to find a file.
I've trid something like this:
find /opt/oracle/diag/*/alert_HH2.log -printordinarily, i can run the ls command and it will find it:
/opt/oracle/diag/*/*/*/*/alert_HH2.log
The problem with this approach is... (3 Replies)
Hi All,
I have a list of words (these are actually a list of database table names separated by comma).
Now, I want to find only the non-existing list of words in the *.java files of current directory and/or its sub-directories.
Sample list of words:... (8 Replies)
Hello All,
I have got some assignment to complete till this Monday and problem statement is as follow :-
Problem :- Find duplicate files (especially .c and .cpp) from two project base directories with following requirement :-
1.Should be extendable to search in multiple base... (4 Replies)
Hi all,
I have two files, chap.txt and complex.txt.
chap.txt looks like this:
a
d
l
m
r
k
complex.txt looks like this:
a c d e l m n j
a d l p q r
c p r m
......... (7 Replies)
Hi,
In the Unix Box, I have a situation, where there is folder name called "Projects" and in that i have 20 Folders S1,S2,S3...S20. In each of the Folders S1,S2,S3,...S20 , there is a same name folder named "MP". So Now, I want to get all the files in all the "MP" Folders and write all those... (6 Replies)
Hi,
I have a directory /home/datasets/ which contains a bunch (720) of subdirectories called hour_1/ hour_2/ etc..etc.. in each of these there is a single text file called (hour_1.txt in hour_1/ , hour_2.txt for hour_2/ etc..etc..) and i would like to do some text processing in them.
Each of... (20 Replies)
I have multiple files that starts as TRADE_LOG spread across multiple folders in the given structure..
./dir1/1/TRADE_LOG*.gz
./dir2/10/TRADE_LOG*.gz
./dir11/12/TRADE_LOG*.gz
./dir12/13/TRADE_LOG*.gz
when I do ftp uisng mput from the "." dir I am getting the below given error
mput... (1 Reply)
hello all.
i would like to be able to find the names of all files on a remote machine using ssh.
i only want the names of files, not directories
so far i'm stuck at "du -a | sort -n"
also, is it possible to write them to a file on my machine? i know how to write it to a file on that... (2 Replies)
I am writing a shell script to search for previous versions of an application...the application is called TAU and basically i want to search the users home directory and /Applications for any instances of a "TAU" folder.. If found i want to give the user the option to remove the old folders and if... (3 Replies)
This is probably very easy but I would like to know a way to list all my files in all my directories that are readable and executable to everyone. I was told to use find or ls and I tried some stuff but couldnt get it to work. I understand that its dangerous to have files with these permissions for... (4 Replies)