how to check availability of data of one file in other


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to check availability of data of one file in other
# 1  
Old 07-05-2010
how to check availability of data of one file in other

hi all
i have two files in unix
1.table.name
2.all.tables
i need to check the availability of all data of table.name in all.tables.both the table contains n number of data.i need a script which will check one by one whether the data exist in table.name or not.I want this in SH.
# 2  
Old 07-05-2010
While an excerpt of your files posted inside code tags would have helped a bit more, here a guess:

Code:
grep -f table.name all.tables

It will print out all matches from 1st file against the 2nd file. If the output has the same number of lines like the 1st file, all lines were found inside the 2nd file. You can check the number of lines of a file with
Code:
grep -f table.name all.tables| wc -l
# and
wc -l < table.name

Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check file availability and place flag file

I have to check a directory on Linux (via shell Script which I am trying to build) for about 20 different source files with file patterns and if the files are made available in the directory, I should place flag files for which my other ETL jobs are waiting on to kick off. If the source files are... (6 Replies)
Discussion started by: dhruuv369
6 Replies

2. UNIX for Dummies Questions & Answers

For loop to check the files availability

Hi, I need a help with my script. Below is my script. What I am doing here is finding the date of the file which I need to process and then finding the list of file names. Based on the list of file names, check has to be done to see if all the files are there and log the details to a error... (3 Replies)
Discussion started by: Vijay81
3 Replies

3. Shell Programming and Scripting

Check File availability

Hi, I have a task to write a script , which will run everyday to check whether my system has received 2 files from source system. It should mail me ( using mailx preferably ) if the files has not arrived from the source. The scenario is everyday I get 2 files from source system.,... (3 Replies)
Discussion started by: cratercrabs
3 Replies

4. Shell Programming and Scripting

Check the ind file before FTP data file....

Hi All, I have posted this issue in the forum, but i did not get any answer. If someone knows about it, could you please let me know hoiw to do it? i am FTP the file from one server to another. The code in FTP should first check the indicator file is available or not? For example, for the data... (1 Reply)
Discussion started by: Amit.Sagpariya
1 Replies

5. Shell Programming and Scripting

urgent help : want to check data in oracle from flate file

Hi All, I have a flat file like this on unix AIX server: MXBOFO CSWP 5340 3794499 MXBOBIS CSWP 5340 3581124 MXBOFO CSWP 5340 3794531 MXBOBIS CSWP 5340 3583720 MXBOFO CSWP 5340 3794514 MXBOBIS CSWP 5340 3580763 MXBOFO CSWP 5340 3795578 MXBOBIS CSWP 5340 3794995 MXBOFO CSWP 5340 3710835... (3 Replies)
Discussion started by: unknown123
3 Replies

6. Solaris

Check Database availability?

Hi All, My script gets aborted as it is connecting as a remote database through a DB link on every 3rd sunday.As the remote DB is down for more than 6 hours. Can TNSPING DBNAME inside my script ensure the database is up??? Then how can i check the database is up or down ? ... (2 Replies)
Discussion started by: megh
2 Replies

7. Shell Programming and Scripting

how to check the file data type(ascii or binary)

hi i am receiving a file from one system , i have to verify the format of the file data i.e whether the data is in acii format or binary format, please help thanks in advance satya (1 Reply)
Discussion started by: Satyak
1 Replies

8. Shell Programming and Scripting

Check whether a given file is in ASCII format and data is tab-delimited

Hi All, Please help me out with a script which checks whether a given file say abc.txt is in ASCII format and data is tab-delimited. If the condition doesn't satisfy then it should generate error code "100" for file not in ASCII format and "105" if it is not in tab-delimited format. If the... (9 Replies)
Discussion started by: Mandab
9 Replies
Login or Register to Ask a Question