Sponsored Content
Top Forums UNIX for Advanced & Expert Users Comparing two files and writing mismatched rows along with mismatched columns. Pointing out the mism Post 302997545 by piyush pankaj on Tuesday 16th of May 2017 08:19:22 AM
Old 05-16-2017
Hi Thanks a lot drl and others for helping me out with the solutions.


Quote:
Originally Posted by drl
Hi.

I overlooked a useful option, so this could eliminate the intermediate step:
Code:
$ dwdiff -d '|' data1 data2
1|piyush|bangalore|[-dev-]{+QA+} 
1|piyush|bangalore|QA 
2|pankaj|bangalore|dev 
3|rohit|[-delhi-]{+bangalore+}|[-QA-]{+dev+}

Best wishes ... cheers, drl
 

10 More Discussions You Might Find Interesting

1. HP-UX

ld: Can't find library or mismatched ABI for -lstdc++

Hi, I am having problem of linking .o and I am working with HP -UX gcc version is 3.4.2 . I have complied few cpp files and got .o's. But at the time of linking i am having issue. it is returning ld: Can't find library or mismatched ABI for -lstdc++ Fatal error. I have lib at location ... (0 Replies)
Discussion started by: ghananil
0 Replies

2. HP-UX

ld: Can't find library or mismatched ABI for

I started building a program which connects to MySQL and got: ld: Can't find library or mismatched ABI for -lmysqlclient_r I tried building my own MySQL and use these, and it worked but then it gave me: ld: Can't find library or mismatched ABI for -lrt But librt is a system library (and... (1 Reply)
Discussion started by: selalerer
1 Replies

3. HP-UX

ld: Can't find library or mismatched ABI for -lstlport_aCC

Hi All, while compiling on HP UX, i am getting the following error ld: Can't find library or mismatched ABI for -lstlport_aCC i am new to unix and HPUX, please suggest solution ASAS thanks in advance vindhyalesh (3 Replies)
Discussion started by: vindhyalesh
3 Replies

4. Linux

Error Mismatched object file

Dear All, Need your help to rectify this error. Recently I have upgraded my Linux server from 32 bit to 64 bit server. OS details are Red Hat Enterprise Linux Server release 5.3 Kernel 2.6.18-120.el5 on an x86_64 After upgradation, when i try to compile or catalog any program, it is... (2 Replies)
Discussion started by: mysmileforu
2 Replies

5. Shell Programming and Scripting

Comparing rows in same file and writing the result in new file

Help needed... Can you tell me how to compare the last two couple entries in a file and print their result in new file..:confused: I have one file Check1.txt \abc1 12345 \abc2 12327 \abc1 12345 \abc2 12330 I want to compare the entries in Check1 and write to... (1 Reply)
Discussion started by: kichu
1 Replies

6. Shell Programming and Scripting

Comparing rows and columns

Hi, i've a .csv file with the data as below: - file1.h, 2.0 file2.c, 3.1 file1.h, 2.5 file3.c, 3.3.3 file1.h, 1.2.3 I want to remove the duplicate file names considering only the one with the highest version number.. output should be file1.h, 2.5 file2.c, 3.1 file3.c,... (3 Replies)
Discussion started by: pravsripad
3 Replies

7. Shell Programming and Scripting

Comparing Columns and writing a new file

I have a table with one column File1.txt 1 2 3 4 5 6 7 8 9 10 Another table with two columns; This has got a subset of entries from File 1 but not unique because they have differing values in col 2. File2.txt 1 a 2 d 2 f 6 r 6 e (3 Replies)
Discussion started by: cs_novice
3 Replies

8. UNIX for Dummies Questions & Answers

Writing a script to take the average of two columns every 3 rows

I have a dataset with 120 columns. I would like to write a script, that takes the average of every two columns, starting from columns 2 and 3, and moving consecutively in frames of 3 columns, all the way until the last column. The first column in the output file would be the averages of columns... (1 Reply)
Discussion started by: evelibertine
1 Replies

9. Shell Programming and Scripting

awk delimiter count if mismatched?

Hi all, I have a file where in it has lot of records in it. I have written below stuff to find the number of fields as shown below `awk -F '|' '{print NF-1}' file.txt| head -1` how do i proceed if in case any record in particular is having more number of delimiters, if it having??? what... (7 Replies)
Discussion started by: nikhil jain
7 Replies

10. Programming

Mismatched free() / delete / delete [] line no missing

Could you tell me the possibilities of the reason to get the Mismatched free() / delete / delete . I unable to see the line no in the valgrind report. it displays the function name. with that function name, I am not able to find where exactly the issue is there.I am getting the Mismatched free()... (3 Replies)
Discussion started by: SA_Palani
3 Replies
dwdiff(1)						    delimited word diff program 						 dwdiff(1)

NAME
dwdiff - a delimited word diff program SYNOPSIS
dwdiff [OPTIONS] <OLD FILE> <NEW FILE> dwdiff [OPTIONS] --diff-input [<DIFF FILE>] DESCRIPTION
dwdiff is a diff program that operates at the word level instead of the line level. It is different from wdiff in that it allows the user to specify what should be considered whitespace, and in that it takes an optional list of characters that should be considered delimiters. Delimiters are single characters that are treated as if they are words, even when there is no whitespace separating them from preceding words or delimiters. dwdiff is mostly command-line compatible with wdiff. Only the --autopager, --terminal and --avoid-wraps options are not supported. The default output from dwdiff is the new text, with the deleted and inserted parts annotated with markers. Command line options are avail- able to change both what is printed, and the markers. OPTIONS
dwdiff accepts the following options (Note that all strings will first be escape expanded. All standard -escapes are supported, as well as u and U Unicode escapes): -h, --help Display a short help message. -v, --version Print version and copyright information. -d <delimiters>, --delimiters=<delimiters> Specify a list of characters to be used as delimiters. -P, --punctuation> Use punctuation characters as delimiters. The exact set of punctuation characters depends on the current locale. -W <whitespace>, --whitespace=<whitespace> Specify a list of characters to be used as whitespace. --diff-input Interpret the input as the output from diff in the Unified Diff format (usually produced by diff -u). In this case only one input file is allowed. This option allows reformating diff output with dwdiff, and is useful for example to post-process the output of svn diff. -1, --no-deleted Suppress printing of words deleted from the first file. -2, --no-inserted Suppress printing of words inserted in the second file. -3, --no-common Suppress printing of words common to both files. -L[<width>], --line-numbers[=<width>] Show line numbers at the start of each line. The line numbers displayed are the line number in the old file and the line number in the new file respectively. The optional <width> argument is the minimum number of positions per line number. -C<num>, --context=<num> Show <num> lines of context before and after each changes. A line with only -- is printed between blocks of changes. -s, --statistics Print statistics when done. The numbers printed include the number of words from in both files, the number of deleted words, the number of inserted words, and the number of changed words. The number of changed words is counted as the number of words that are removed from the first file, and the number of words that replace them from the second file. All of these numbers are also expressed as a percentage of the total number of words in the file the words came from. -i, --ignore-case Ignore differences in case when comparing words. This option is only available if the diff program that is called provides it. -I, --ignore-formatting Ignore differences in formatting of characters. This option switches to using the Unicode compatibility decomposition instead of the canonical decomposition. The compatibility decomposition discards formatting information. For example, the ligature fi will be decomposed into two separate characters for the purposes of comparison. However, also super- and subscript will be regarded equal as well as different rotations of the same character. -c[<spec>], --color[=<spec>] Color mode. The optional <spec> can be used to customize the colors. <spec> consists of [<delete>],[<insert>]. If either is omited it will be set to its default color (bright red or bright green respectively). Both parts of the <spec> consist of [<fore- ground>][:<background>]. To obtain a list of permissible color names, use the word ``list'' as <spec>. Alternatively, you can spec- ify any escape sequence to set attributes as a color by prepending e:. The standard markers for the begin and end of deleted and inserted text are suppressed, but any markers specified on the command line will still be printed. -l, --less-mode As -p but also overstrike deleted whitespace. -p, --printer Use overstriking with an underscore and bold text to emphasize changes. This is implemented by first printing the underscore or a duplicate of the character to be printed, followed by a backspace, followed by the character. On regular terminals you won't see any effect. The less(1) command will however show underlined and bold text. The standard markers for the begin and end of deleted and inserted text are suppressed, but any markers specified on the command line will still be printed. -m<num>, --match-context=<num> Use <num> words of context before and after words for matching. Words in the old text will then only match words in the new text if words surrounding them are also equal. This improves the output for dwdiff for large changes with frequently occuring words. How- ever, using context requires more disk space and more processing time. The default value is 1. Set this option to 0 to revert to the pre 1.5 behavior. --aggregate-changes Allow multiple close changes to be treated as one change, if context words are used (see --match-context). This option reduces the processing time as the changes reported by the diff program are not post-processed to give more precise results. -A <algorithm>, --algorithm=<algorithm> Select the algorithm to be used for determining differences. There are three possible values for algorithm: best, which tries to find the minimal set of changes, normal, which trades some optimality for speed, and fast, which assumes that the input is large and contains few changes. By default the normal algorithm is used. -S[<marker>], --paragraph-separator[=<marker>] Show insertion or deletion of blocks of lines with only whitespace characters. A special marker is inserted into the output to indicate these blocks. The default marker is <-->. --wdiff-output Create wdiff compatible output. The dwdiff program uses a different output algorithm, which provides a more intuitive output. -w <string>, --start-delete=<string> Specify a string to mark begin of deleted text. -x <string>, --stop-delete=<string> Specify a string to mark end of deleted text. -y <string>, --start-insert=<string> Specify a string to mark begin of inserted text. -z <string>, --stop-insert=<string> Specify a string to mark end of inserted text. -R, --repeat-markers Repeat the begin and end markers at the start and end of line if a change crosses a newline. A single dash (-) as a file can be used to denote standard input. Only one file can be read from standard input. To stop dwdiff from inter- preting file names that start with a dash as options, one can specify a double dash (--) after which dwdiff will interpret any following arguments as files to read. BUGS
If you think you have found a bug, please check that you are using the latest version of dwdiff [http://os.ghalkes.nl/dwdiff.html]. When reporting bugs, please include a minimal example that demonstrates the problem. AUTHOR
G.P. Halkes <dwdiff@ghalkes.nl> COPYRIGHT
Copyright (C) 2006-2011 G.P. Halkes and others dwdiff is licensed under the GNU General Public License version 3. For more details on the license, see the file COPYING in the documentation directory. On Un*x systems this is usually /usr/share/doc/dwdiff-2.0.4. SEE ALSO
dwfilter(1), wdiff(1), diff(1) Version 2.0.4 12-06-2012 dwdiff(1)
All times are GMT -4. The time now is 07:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy