Sponsored Content
Top Forums Shell Programming and Scripting How to compare 2 file with Condition. Post 302668907 by ooilinlove on Tuesday 10th of July 2012 06:42:30 AM
Old 07-10-2012
Bug How to compare 2 file with Condition.

Hello,

I need to run a command or shell script that will compare 2 file with Condition.

Can you please help ?

thank you.

File 1.
Code:
############start@linda22 ... ##################
aaaaaaa
bbbbbbb
cccccc
dddddd
eeeee
11111
############start@linda23 ... ##################
aaaaaaa
bbbbbbb
cccccc
111111
222222
############start@anca2 ... ##################
ffffff
111111
############start@sium22 ... ##################
aaaaaaa
bbbbbbb
ffffff
222222
############start@nesium23 ... ##################
bbbbbbb
ffffff
111111
333333

File 2.
Code:
aaaaaaa
bbbbbbb
cccccc
dddddd
eeeee
ffffff

Ex of Out Put.
Code:
############start@linda22 ... ##################
aaaaaaa
bbbbbbb
cccccc
dddddd
eeeee
############start@linda23 ... ##################
aaaaaaa
bbbbbbb
cccccc
############start@anca2 ... ##################
ffffff
############start@sium22 ... ##################
aaaaaaa
bbbbbbb
ffffff
############start@nesium23 ... ##################
bbbbbbb
ffffff

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to compare null and space using single if condition

Hi I have a input file with many fields and each filed will be with in double quotes(""). i want to check fields contains balnk,null or space using condition using if. when i write code as below for if condition its not working a=`awk -F ',' '{gsub("\"", "", $1);'NF==0';printf $1}'... (3 Replies)
Discussion started by: jayakumarrt
3 Replies

2. Shell Programming and Scripting

How to compare 2 files & get only few columns based on a condition related to both files?

Hiiiii friends I have 2 files which contains huge data & few lines of it are as shown below File1: b.dat(which has 21 columns) SSR 1976 8 12 13 10 44.00 39.0700 70.7800 7.0 0 0.00 0 2.78 0.00 0.00 0 0.00 2.78 0 NULL ISC 1976 8 12 22 32 37.39 36.2942 70.7338... (6 Replies)
Discussion started by: reva
6 Replies

3. Shell Programming and Scripting

Compare columns of 2 files based on condition defined in a different file

I have a control file which tells me which are the fields in the files I need to compare and based on the values I need to print the exact value if key =Y and output is Y , or if output is Y/N then I need to print only Y if it matches or N if it does not match and if output =N , then skip the feild... (7 Replies)
Discussion started by: newtoawk
7 Replies

4. Shell Programming and Scripting

compare 2 files and extract the data which is not present in other file with condition

I have 2 files whose data's are as follows : fileA 00 lieferungen 00 attractiop 01 done 02 forness 03 rasp 04 alwaysisng 04 funny 05 done1 fileB alwayssng dkhf fdgdfg dfgdg sdjkgkdfjg funny rasp (7 Replies)
Discussion started by: rajniman
7 Replies

5. Shell Programming and Scripting

Compare the two variable with if condition

Please help me with this: I need to compare two values in if condition in shell script but its goes always to else condition: TIME_CHECK=PM TIME-CLOCK=PM if ; then echo "You have access!" else echo "ACCESS DENIED!" fi (5 Replies)
Discussion started by: aroragaurav.84
5 Replies

6. Shell Programming and Scripting

compare 2 files and return unique lines in each file (based on condition)

hi my problem is little complicated one. i have 2 files which appear like this file 1 abbsss:aa:22:34:as akl abc 1234 mkilll:as:ss:23:qs asc abc 0987 mlopii:cd:wq:24:as asd abc 7866 file2 lkoaa:as:24:32:sa alk abc 3245 lkmo:as:34:43:qs qsa abc 0987 kloia:ds:45:56:sa acq abc 7805 i... (5 Replies)
Discussion started by: anurupa777
5 Replies

7. Shell Programming and Scripting

IF condition to compare file prefix

I have files with naming as below, testS123, testS223, testB1, testC1, testD1 I need to write a if condition to print 'Hello' when the file prefix is not testS* else 'Good bye'. if then echo "Hello" else echo "Good bye" fi; (1 Reply)
Discussion started by: r@v!7*7@
1 Replies

8. UNIX for Beginners Questions & Answers

Compare between two files with condition

Hello there. I am trying to compare two files. File1 Austria Mobile 1 United Kingdom Mobile 1 ... File2 Austria Mobile Vien 2 Austria Mobile Ostr 0 United Kingdom Mobile Dev 0.7 United Kingdom Mobile OST 1.5 What i want to do is to compare both files and... (12 Replies)
Discussion started by: dragonfly85
12 Replies

9. UNIX for Beginners Questions & Answers

Compare two files with awk and condition

I am preparing a script to check the configuration of the db2 against the standard configuration. I am fetching the output in file A and want to compare it with the standard output written in file B. File A Diagnostic error capture level (DIAGLEVEL) = 3 Audit buffer size (4KB) (AUDIT_BUF_SZ)... (2 Replies)
Discussion started by: bashb
2 Replies
Color::Scheme(3pm)					User Contributed Perl Documentation					Color::Scheme(3pm)

NAME
Color::Scheme - generate pleasant color schemes SYNOPSIS
use Color::Scheme; my $scheme = Color::Scheme->new ->from_hex('ff0000') # or ->from_hue(0) ->scheme('analog') ->distance(0.3) ->add_complement(1) ->variation('pastel') ->web_safe(1) my @list = $scheme->colors(); # @list = ( "999999","666699","ffffff","99cccc", # "999999","666699","ffffff","9999cc", # "669999","666699","ffffff","99cccc", # "cccccc","996666","ffffff","cccc99" ) my $set = $scheme->colorset(); # $set = [ [ "999999","666699","ffffff","99cccc", ], # [ "999999","666699","ffffff","9999cc", ], # [ "669999","666699","ffffff","99cccc", ], # [ "cccccc","996666","ffffff","cccc99" ] ] DESCRIPTION
This module is a Perl implementation of Color Schemes 2 (<http://wellstyled.com/tools/colorscheme2/>), a color scheme generator. Start by visitng the Color Schemes 2 web site and playing with the colors. When you want to generate those schemes on the fly, begin using this modoule. The descriptions herein don't make too much sense without actually seeing the colorful results. Henceforth, paragraphs in quotes denote documentation copied from Color Schemes 2. "Important note: This tool doesn't use the standard HSV or HSB model (the same HSV/HSB values ie. in Photoshop describe different colors!). The color wheel used here differs from the RGB spectre used on computer screens, it's more in accordance with the classical color theory. This is also why some colors (especially shades of blue) make less bright shades than the basic colors of the RGB-model. In plus, the RGB- model uses red-green-blue as primary colors, but the red-yellow-blue combination is used here. This deformation also causes incompatibility in color conversions from RGB-values. Therefore, the RGB input (eg. the HTML hex values like #F854A9) is not exact, the conversion is rough and sometimes may produce slightly different color." METHODS
new() The "new" method will return a new "Color::Scheme" object. colors() Returns an array of 4, 8, 12 or 16 colors in "RRGGBB" hexidecimal notation (without a leading "#") depending on the color scheme and add- Complement parameter. For each set of four, the first is usually the most saturated color, the second a darkened version, the third a pale version and fourth a less-pale version. For example: With a contrast scheme, "colors()" would return eight colors. Indexes 1 and 5 could be background colors, 2 and 6 could be foreground colors. Trust me, it's much better if you check out the Color Scheme web site, whose URL is listed in in "DESCRIPTION". colorset() Returns a list of lists of the colors in groups of four. This method simply allows you to reference a color in the scheme by its group isntead of its absolute index in the list of colors. I am assuming that "colorset()" will make it easier to use this module with the tem- plating systems that are out there. For example, if you were to follow the synopsis, say you wanted to retrieve the two darkest colors from the first two groups of the scheme, which is typically the second color in the group. You could retrieve them with "colors()": my $first_background = ($scheme->colors)[1]; my $second_background = ($scheme->colors)[5]; Or, with this method, my $first_background = $scheme->colorset->[0][1]; my $second_background = $scheme->colorset->[1][1]; from_hue( degrees ) Sets the base color hue, where "degrees" is an integer. (Values greater than 359 and less than 0 wrap back around the wheel.) The default base hue is 0, or bright red. from_hex( color ) Sets the base color to the given color, where "color" is in the hexidecimal form RRGGBB. "color" should not be preceeded with a hash (#). The default base color is the equivalent of #ff0000, or bright red. add_complement( BOOLEAN ) If BOOLEAN is true, an extra set of colors will be produced using the complement of the selected color. This only works with the analogic color scheme. The default is false. web_safe( BOOL ) Sets whether the colors returned by "colors()" or "colorset()" will be web-safe. The default is false. distance( FLOAT ) "FLOAT" must be a value from 0 to 1. You might use this with the "triade", "tetrade" or "analogic" color schemes. The default is 0.5. scheme( name ) "name" must be a valid color scheme name. See "COLOR SCHEMES". The default is "mono". variation( name ) "name" must be a valid color variation name. See "COLOR VARIATIONS". COLOR SCHEMES
The following documentation is adapated (and mostly copied verbatim) from the Color Schemes 2 help. Use one of these scheme names as an argument to the "scheme()" method. monochromatic (or mono) "Monochormatic scheme is based on only one color tint, and uses only variations made by changing its saturation and brightness. Black and white colors are always added. The result is comfortable for eyes, even when using aggressive color. However, it's harder to find accents and highlights. "The application makes only several monochromatic variants of each color. You'll be able to make others - more or less saturated, lighter or darker. Monochromatic variations are made for each color in other schemes, too." contrast "Base color is supplemented with its complement (color on the opposite side of the wheel). One warm and one cold color is always created - we have to consider, which one will be dominant, and if the result should look warm, or cold. Suitable monochromatic variations of this two colors may be added to the scheme." triade "Base color is supplemented with two colors, placed identically on both sides of its complement. Unlike the 'sharp' contrast, this scheme is often more comfortable for the eyes, it's softer, and has more space for balancing warm and cold colors. "You can use the "distance()" method to set the distance of these colors from the base color complement. The less the value is, the closer the colors are to the contrast color, and are more similar. The best value is between 0.25 and 0.5. Higher values aren't too suitable - except the shift by 60o, which makes another color scheme, the triade: "The triade is made by three colors evenly distributed on the thirds of the color wheel (by 120 degrees). The triade-schemes are vibrating, full of energy, and have large space to make contrasts, accents and to balance warm and cold colors. You can make the triade in the 'soft contrast' scheme setting the distance to the maximal value, 1." tetrade "This scheme, also known as 'double-contrast,' is made by a pair of colors and their complements. It's based on the tetrade - the foursome of colors evenly distributed on the fourths of the color wheel (by 90 degreees). The tetrade is very aggressive color scheme, requiring very good planning and very sensitive approach to relations of these colors. "Less distance between two base colors causes less tension in the result. However, this scheme is always more 'nervous' and 'action' than other schemes. While working with it, we have to take care especially of relations between one color and the complement of its adjacent color - in case of the tetrade (maximum distance 1), good feeling and very sensitive approach are necessary." analogic "This scheme is made by base color and its adjacent colors - two colors identically on both sides. It always looks very elegantly and clear, the result has less tension and it's uniformly warm, or cold. If a color on the warm-cold border is chosen, the color with opposite 'temperature' may be used for accenting the other two colors. "You can set the distance of adjacent colors by using "distance()". Values between 0.25 and 0.5 (15-30 degrees on the wheel) are optimal. You can also add the contrast color; the scheme is then supplemented with the complement of the base color. It must be treated only as a complement - it adds tension to the palette, and it's too aggressive when overused. However, used in details and as accent of main colors, it can be very effective and elegant." COLOR VARIATIONS
"Each of colors in displayed scheme has four variations. These are colors of the same hue, but they differ in the saturation and bright- ness. ... The very first variation ... is the base variation, which determines the look of the scheme. The other three variations are just additional. Iff the scheme is made by less than four colors, the unused place is used to display variations (or the complement) of the base color." Use one of these variation names as an argument to the "variation()" method. default The default preset. Generally pretty nice. pastel Softer colors with added whiteness. soft Darker pastel colors. light Very light, almost washed-out colors. hard Deeper, more-saturated colors. pale Greyer, less-saturated colors. AUTHOR
Color Schemes 2, its documentation and original JavaScript code are copyright pixy <http://www.wellstyled.com/> This Per; module was created by Ian Langworth <ian.langworth@gmail.com> COPYRIGHT &; LICENSE Copyright (C) 2005 Ian Langworth This license has been granted explictly by the author of Color Schemes 2. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.8.8 2006-01-28 Color::Scheme(3pm)
All times are GMT -4. The time now is 11:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy