Sponsored Content
Top Forums Shell Programming and Scripting find difference in file column... Post 302307289 by malcomex999 on Wednesday 15th of April 2009 04:18:34 AM
Old 04-15-2009
find difference in file column...

Hi All,

i have a file that is tab delimited. i need help to find the rows which are having same price based on the site code but some times, there are difference so i need to find only the records which are different in all site code.

Dept Sec Barcode 10001 10002 10003 10004
FMG Grocery 6271100040072 12.50 12.50 12.50 13.00
FMG Grocery 6271100041567 15.50 16.00 16.00 16.00
FMG Grocery 6271100041574 20.00 20.00 20.00 20.00
FMG Grocery 2000000159164 10.00 10.00 10.00 10.00
FMG Grocery 6271100041536 8.50 9.00 9.00 8.50

so above is the sample input and i need the output as below...

Dept Sec Barcode 10001 10002 10003 10004
FMG Grocery 6271100040072 12.50 12.50 12.50 13.00
FMG Grocery 6271100041567 15.50 16.00 16.00 16.00
FMG Grocery 6271100041536 8.50 9.00 9.00 8.50

Thanks,
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to compare first column of two files and find difference

Hi, I want to write a script which will compare the 1st column of both the files and will give the difference. e.g:- my 1st file contains: 89 /usr 52 /usr/local 36 /tmp 92 /opt 96 /home 27 /etc/opt/EMCom 1 ... (3 Replies)
Discussion started by: adityam
3 Replies

2. Shell Programming and Scripting

Calculate difference between consecutive data points in a column from a file

Hi, I have a file with one column data (sample below) and I am trying to write a shell script to calculate the difference between consecutive data valuse i.e Var = Ni -N(i-1) 0.3141 -3.6595 0.9171 5.2001 3.5331 3.7022 -6.1087 -5.1039 -9.8144 1.6516 -2.725 3.982 7.769 8.88 (5 Replies)
Discussion started by: malandisa
5 Replies

3. Shell Programming and Scripting

Script to find difference between 2 files by column

Hi , i am newbie to shell scripting and am trying to do the below job, A shell script to be run with a command like sh Compare.ksh file1.txt file2.txt 1 2 > file3.txt 1 2-are the key columns Consider the delimiter would be Tab or comma File 1: SK TEST NAME MATHS PHYSICS 21 1... (1 Reply)
Discussion started by: shakthi666
1 Replies

4. Homework & Coursework Questions

Script to find difference between 2 files by column

Hi , i am newbie to shell scripting and am trying to do the below job, A shell script to be run with a command like sh Compare.ksh file1.txt file2.txt 1 2 > file3.txt 1 2-are the key columns Consider the delimiter would be Tab or comma File 1: SK TEST NAME MATHS PHYSICS 21 1 AAA... (1 Reply)
Discussion started by: shakthi666
1 Replies

5. Shell Programming and Scripting

Difference of the same column when two other column matches and one column differs less than 1 hour

This is my input file : # cat list 20130430121600, cucm, location,76,2 20130430121600,cucm1,location1,76,4 20130430122000,cucm,location,80,8 20130430122000,cucm1,location1,90,8 20130430140000,cucm1,location1,87,11 20130430140000, cucm,location,67,9 This is the required output ... (1 Reply)
Discussion started by: Lakshmikumari
1 Replies

6. Shell Programming and Scripting

Difference between 2 files, one with 1 column and 2nd file with multiple columns

Hi, I need to find the difference between 2 files in unix and write the result in the new file File1: A B File2: X 123 hajkd Y 345 adjfka A 123 djafjhd B 678 dsndjks Output file: X 123 hajkd Y 345 adjfka Thanks. (6 Replies)
Discussion started by: nani1984
6 Replies

7. Shell Programming and Scripting

I want to find the difference between two files, only for the header (column names)

Hi All, I want to find the difference between two files, by checking only the headers (column names) and report if any new column is added in the latest file. For Ex: If the file "declartion.txt has these columns url;image;id;showcase_id;showcase_name and the actual file "feed.txt" has... (34 Replies)
Discussion started by: Praveen Pandit
34 Replies

8. UNIX for Dummies Questions & Answers

Find the timestamp difference between two different colums in a file

Sample Input File 2014/10/09 CDE876172588765 00:09:45 00:10:10 200 200 11.7093 2014/10/09 CDE366134588757 01:04:34 01:04:54 210 210 9.8898 2014/10/09 CDE765172345745 03:05:46 03:06:01 100 100 10.0601 2014/10/09 ... (8 Replies)
Discussion started by: rpm120
8 Replies

9. UNIX for Beginners Questions & Answers

UNIX utility to find difference in folder, file and contents of file against a base version

Hi, I am trying to find out whether there are any Unix utilities that compares folders, files and contents within the file and provides a comprehensive report. The comparison can be against base version of a folder and file with content. Can you please let me know of such a utility? Thanks,... (6 Replies)
Discussion started by: Sripathi_ks
6 Replies

10. UNIX for Beginners Questions & Answers

awk code to find difference in second file which is not present in first file .

Hi All, I want to find difference between two files and output only lines which are not present in second file .I am using awk and I am getting only the first difference but I want to get all the lines which are not present in file2 .Below is the code I am using . Please help to get the desired... (7 Replies)
Discussion started by: srinivasrao
7 Replies
Barcode::Industrial2of5(3pm)				User Contributed Perl Documentation			      Barcode::Industrial2of5(3pm)

NAME
GD::Barcode::Industrial2of5 - Create Industrial2of5 barcode image with GD SYNOPSIS
ex. CGI use GD::Barcode::Industrial2of5; binmode(STDOUT); print "Content-Type: image/png "; print GD::Barcode::Industrial2of5->new('1234567890')->plot->png; with Error Check my $oGdBar = GD::Barcode::Industrial2of5->new('A12345678'); die $GD::Barcode::Industrial2of5::errStr unless($oGdBar); #Invalid Characters $oGdBar->plot->png; DESCRIPTION
GD::Barcode::Industrial2of5 is a subclass of GD::Barcode and allows you to create Industrial2of5 barcode image with GD. new $oGdBar = GD::Barcode::Industrial2of5->new($sTxt); Constructor. Creates a GD::Barcode::Industrial2of5 object for $sTxt. $sTxt has numeric characters([0-9]). plot() $oGd = $oGdBar->plot([Height => $iHeight, NoText => 0 | 1]); creates GD object with barcode image for the $sTxt specified at new method. $iHeight is height of the image. If NoText is 1, the image has no text image of $sTxt. ex. my $oGdB = GD::Barcode::Industrial2of5->new('12345678'); my $oGD = $oGdB->plot(NoText=>1, Height => 20); # $sGD is a GD image with Height=>20 pixels, with no text. barcode() $sPtn = $oGdBar->barcode(); returns a barcode pattern in string with '1' and '0'. '1' means black, '0' means white. ex. my $oGdB = GD::Barcode::Industrial2of5->new('12345678'); my $sPtn = $oGdB->barcode(); $errStr $GD::Barcode::Industrial2of5::errStr has error message. $text $oGdBar->{$text} has barcode text based on $sTxt specified in new method. AUTHOR
Kawai Takanori GCD00051@nifty.ne.jp COPYRIGHT
The GD::Barocde::Industrial2of5 module is Copyright (c) 2000 Kawai Takanori. Japan. All rights reserved. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. SEE ALSO
GD::Barcode perl v5.12.3 2003-05-29 Barcode::Industrial2of5(3pm)
All times are GMT -4. The time now is 05:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy