script to compare files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script to compare files
# 1  
Old 10-19-2005
script to compare files

HI

i wil get input from sql query and that too i can get a list o f files or just one.

i have to pick up a file from another directory which hads prefix to this prefix.x.x.x.x.x. And we have to discard prefix and use that file name.

we have to compare this file name(no need to worry about fields) just file name only with input file if they are match the we have to pick this file (not from input) and write to a file if it doesnt match then distict of input files.we have to check each and every file from input

for ex input file will be like x.x.x.x.x
otherfile will be like prefi.x.x.x.x.x.x



can any one help to write in KSH
Thanks in Advance
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to extract/compare from two files.

I have two files : Alpha and Beta. The files are as follows (without arrow marks.) Alpha: A 1 D 90 G 11 B 24 C 15 Beta: B 24 C 0 <-- G 11 D 20 <-- A 4 <-- E 777 <-- Expected output of the script : Alpha: (2 Replies)
Discussion started by: linuxadmin
2 Replies

2. Shell Programming and Scripting

Script to compare two text files

i am working on a shell script and need help in the comparing part of it. for e.g. there two text files like this: file1.txt name1 name2 name3 file1 has to be comared with file2 defaultfile.txt name1 name2 name3 name4 and during comparision with defaultfile.txt if... (2 Replies)
Discussion started by: draghun9
2 Replies

3. UNIX for Dummies Questions & Answers

Unix Script to compare two files

Hello, I have a dat file nctilllist.dat which will be present in the directory path "/usr/lpp/web-data/mfg/nct/file-data/nctilllist.dat" nctillist.dat will have reference to files like DP100001.jpg,DP10002.PDF,DP100003.doc on the path /usr/lpp/web-data/mfg/nct/file-data will have... (12 Replies)
Discussion started by: gayathrivm
12 Replies

4. Shell Programming and Scripting

Compare two files using shell script

Hi i want to compare two files and i need the o/p of only difference here the files file1 achilles aedxbepo aedxbwdm01 aedxbwdm02 albedo amarice ambrister anakin anton argon artephius asgard avatar aymara (10 Replies)
Discussion started by: venikathir
10 Replies

5. Shell Programming and Scripting

Shell script to compare two files

I have two files; file A and file B. I need all the entries of file A to be compared with file B line by line. If the entry exists on file B, then save those on file C; if no then save it on file D Note :- all the columns of the lines of file A need to be compared, except the last two columns... (8 Replies)
Discussion started by: ajiwww
8 Replies

6. Shell Programming and Scripting

Perl script to compare two files

hi, As such I am new to perl on google search I found a code for Perl script to compare two files and print differences between them and instead of prinintg I want to store the diff. in a outputfile so can sombody provide assistance upon this from where can I edit in script to store the diff in... (1 Reply)
Discussion started by: dinesh.4126
1 Replies

7. Shell Programming and Scripting

Shell Script to Compare Two Files

I have a directory with about 6 files that we receive regularly. these 6 files contain information for 3 different units, 2 for each unit. files related to a specific unit are named similarly with a change in number at the end of the file. the numbers should be sequential. for each grouping of... (3 Replies)
Discussion started by: scriptman237
3 Replies

8. Shell Programming and Scripting

script compare files and backup

Im working on a shell script that uses three parameters, a string to replace, the string replacing, and a file name. In this script it makes a back up file before the replacement occurs. However I want to be able to either search the file to see if it has the string and if it doesnt dont create... (5 Replies)
Discussion started by: gordonheimer
5 Replies

9. UNIX and Linux Applications

How to compare two files using shell script

hi experts please help me to compare two files which are in different directory file1<file will be master file> (/home/rev/mas.txt} ex x1 x2 file2 <will be in different folder> (/home/rev/per/.....) ex x3 x4 the filesinside per folder i need to compare with master file... (1 Reply)
Discussion started by: revenna
1 Replies
Login or Register to Ask a Question
GUARDS(1)						User Contributed Perl Documentation						 GUARDS(1)

NAME
guards - select from a list of files guarded by conditions SYNOPSIS
guards [--prefix=dir] [--path=dir2:dir2:...] [--default=0|1] [-v|--invert-match] [--list|--check] [--config=file] symbol ... DESCRIPTION
The script reads a configuration file that may contain so-called guards, file names, and comments, and writes those file names that satisfy all guards to standard output. The script takes a list of symbols as its arguments. Each line in the configuration file is processed separately. Lines may start with a number of guards. The following guards are defined: +xxx Include the file(s) on this line if the symbol xxx is defined. -xxx Exclude the file(s) on this line if the symbol xxx is defined. +!xxx Include the file(s) on this line if the symbol xxx is not defined. -!xxx Exclude the file(s) on this line if the symbol xxx is not defined. - Exclude this file. Used to avoid spurious --check messages. The guards are processed left to right. The last guard that matches determines if the file is included. If no guard is specified, the --default setting determines if the file is included. If no configuration file is specified, the script reads from standard input. The --check option is used to compare the specification file against the file system. If files are referenced in the specification that do not exist, or if files are not enlisted in the specification file warnings are printed. The --path option can be used to specify which directory or directories to scan. Multiple directories are separated by a colon (":") character. The --prefix option specifies the location of the files. AUTHOR
Andreas Gruenbacher <agruen@suse.de> (SuSE Linux AG) perl v5.14.2 2012-03-04 GUARDS(1)