Hi Frnds...
I have an input file name.txt and another file named as source.. name.txt is having only one column and source is having around 25 columns...i need to read from name.txt line by line and search it in source file and then save the result in results file..
I have a rough idea about the same...that a loop should be taken for the same and it searching can be done by awk filter as source file is quite big...and then the output can be redirected to results..
can someone plzz help me out with this..
Thanks a lot buddy...but i need to read the file as well..also the file from which i need to search the data is quite big so grep may get fail...
i m stuck with the use of awk here... :wall:
hi buddy..thanks for the same...but it is not searching the msisdn i.e. numbers present in the name.txt file...i feel we need to use grep or awk for the same...plzz some1 help me out wid d same... :wall:
It will be great for us as well to see the Sample input file, data file and ur expected output. Like this, all can only give wild guesses and you will all the time end up banging your head on the wall :wall: like the way you are doing for past few posts :rolleyes:
---------- Post updated at 07:59 AM ---------- Previous update was at 07:58 AM ----------
it works with other unix systems but i am using below one :
Linux magnolia 2.6.16.60-0.21-smp #1 SMP Tue May 6 12:41:02 UTC 2008 x86_64 x86_64 x86_64 GNU/Linux
It is showing incorrect output with the awk filter..is it that awk doesnt work fine with the above system???
If you can please post the output of the above script here?
---------- Post updated at 11:15 AM ---------- Previous update was at 11:01 AM ----------
What if the source.txt contains for eg. 09311424354 in imsi field as well? or somewhere else?
Rather this will be more robust and will eliminate possibility of above scene:
cat name.txt | while read line
do
grep -e "^${line}" source.txt >> resultfile.txt
done
```[/b]
Including ^ \(carat\) above will ensure that the pattern is searched at the beginning of the line only, not in between :\)
helloo..
the source file is quite big.....say 800000 records and name.txt is having 8000 records so i m not sure whether grep will not take that much of time...
hi frnz...
thnx fr dis much help....
nw i want a bit more extended version of this filteration script...
i have 5 files A,B,C,D and E located at /home/anubha
I have a file F located at /home/anubha/ed
File F has some records which can be matched in A,B,C,D and E
and another set of files on the basis of these filteration should be created i.e. G,H,I,J and K to be stored at /home/anubha/priya
Plsss help me out....pls pls pls..pls pls pls...:wall::wall: