Sponsored Content
Full Discussion: FILE Comaprison
Top Forums Shell Programming and Scripting FILE Comaprison Post 302076175 by sandeep_hi on Friday 9th of June 2006 10:03:49 AM
Old 06-09-2006
FILE Comaprison

Is it possible to comapre 2 files bit by bit and output the following things:
1. Bit position of mismatch in each line
2. Missing records in either of the two files


Note 3rd column in both the files is unique

File 1

ABC 1212 san
ASB 2121 van
AWS 2122 man
AKS 1112 dan
AQZ 1123 ran
SQA 3232 jam
BQA 3121 pan
GAT 3452 wat


File 2

ABC 1212 san
ASB 2222 van
AWS 2122 man
AQZ 1123 ran
AQZ 1123 wat
DAT 3223 sat
SQA 3232 jam
BQA 3121 pan
GAT 3452 wat


Output File

Records missing in file 1 are: DAT 3223 sat, AQZ 1123 wat
Records missing in file 2 are: AKS 1112 dan
Mismatch in bit position: 6 & 8 for string van



Please help in this regard

Last edited by sandeep_hi; 06-09-2006 at 11:35 AM..
 

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Match list of strings in File A and compare with File B, C and write to a output file in CSV format

Hi Friends, I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving... File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Discussion started by: asnandhakumar
6 Replies

2. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies

3. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
PGN-EXTRACT(1)						      General Commands Manual						    PGN-EXTRACT(1)

NAME
pgn-extract - a Portable Game Notation (PGN) extractor SYNOPSIS
pgn-extract [flags] file.pgn [file.pgn ...] DESCRIPTION
This manual page briefly documents pgn-extract. This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. OPTIONS
-7 Output the seven tag roster for each game. Other tags, apart from FEN and possible ECo/Opening/Variation) are lost. -aoutputfile The file to which extracted games are to be appended. See -o flag for overwriting an existing file. -Aargsfile Read the program's arguments from argsfile. -b[elu]num Restricted bounds on the number of moves in a game; lnum set a lower bound of `num' moves, unum set an upper bound of `num' moves, otherwise num (or enum) means equal-to `num' moves. -cfile[.pgn] Use file as a list of check files for duplicates. -C Don't include comments in the output. Ordinarily these are retained. -dduplicatefile The file to which duplicate extracted games are to be written. -D Don't output duplicate extracted game scores. -eECO_file Perform ECO classification of games. The optional ECO_file should contain a PGN format list of ECO lines. Default is to use /usr/share/pgn-extract/eco.pgn as ECO_file. -E[123] Split output into separate files according to ECO. E1: Produce files from ECO letter, A.pgn, B.pgn, etc. E2: Produce files from ECO letter and first digit, A0.pgn, etc. E3: Produce files from full ECO code, A00.pgn, A01.pgn, etc. All files are opened in append mode. -ffile_list The file file_list contains the list of PGN files to be searched - one per line. -F Output a FEN string comment of the final game position. -h Print an abbreviated list of help. -h1 Print further help. -? Print an abbreviated list of help. -llogfile Create a new logfile for the diagnostics rather than using stderr. -Llogfile Append all diagnostics to logfile rather than using stderr. -noutputfile Write all valid games not otherwise output to outputfile. -N Don't include NAGs in the output. Ordinarily these are retained. -ooutputfile The file to which extracted games are to be written. Any existing contents of the file are lost (see -a flag). -P Don't match permutations of the textual variations (-v). -r Report any errors but don't extract. -Rtagorder Use the tag ordering specified in the file tagorder. -s Silent mode don't report each game as it is extracted. -S Use a simple soundex algorithm for tag matches. If used, this option must precede the -t or -T options. -ttagfile File of player, date, or result, extraction criteria. -Tcriterion Player, date, or result, extraction criteria. -U Don't output games that only occur once. (Use with -d to identify duplicates in multiple files.) -vvariations The file variations contains the textual lines of interest. -V Don't include variations in the output. Ordinarily these are retained. -wwidth Set width as an approximate line width for output. -W Don't rewrite the moves into Standard Algebraic Notation. -W[cm|epd|san|elalg|lalg|halg] Specify the output format to use. Default is san: standard algebraic notation. cm is ChessMaster format. epd is EPD format. lalg is long algebraic. halg is hyphenated long algebraic. elalg is enhanced long algebraic. Use -Wsan[PNBRQK] for language specific output, e.g., use -WsanBSLTDK for German. Similarly for -Welalg[PNBRQK]. -xvariations The file variations contains the lines resulting in positions of interest. -zendings The file endings contains the end positions of interest. -Z Use the file virtual.tmp as an external hash table for duplicates. Use when MallocOrDie messages occur with big datasets. -#num Output num games per file, to files named 1.pgn, 2.pgn, etc. AUTHOR
Pgn-extract was written by David Barnes <D.J.Barnes@ukc.ac.uk>. This manual page was written by Peter van Rossum <petervr@debian.org>, for the Debian GNU/Linux system. March 11, 2001 PGN-EXTRACT(1)
All times are GMT -4. The time now is 01:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy