Sponsored Content
Top Forums Shell Programming and Scripting Compare semicolon seperated data in 2 files using shell script Post 302372013 by novice82 on Monday 16th of November 2009 11:44:59 PM
Old 11-17-2009
Compare semicolon seperated data in 2 files using shell script

hello members,

I have some data ( seperated by semicolon ) with close to 240 rows in a text file temp1.
temp2.txt stores 204 rows of data ( seperated by semicolon ).
I want to :
Sort the data in both files by field1.i.e first data field in every row.
compare the data in both files and print out the rows that are not equal in seperate files.

I was trying to do this with excel using vlookup, without a great deal of success. hence, i'm exploring the shell script option.

Code:
temp1.txt
1000xyz400100xyzA00680xyz0;19722.83;19565.7;157.13;11;2.74;11.00
1000xyz400100xyzA00682xyz0;7210.68;4111.53;3099.15;216.95;1.21;216.94
1000xyz430200xyzA00651xyz0;146.70;0.00;0.00;0.00;0.00;0.00

temp2.txt
1000xyz400100xyzA00680xyz0;19722.83;19565.7;157.13;11;2.74;11.00
1000xyz400100xyzA00682xyz0;7210.68;4111.53;3099.15;216.95;1.21;216.94

Appreciate if you can get me started. I have a solaris machine, where i intend to run the scripts.

regards,

kris
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

converting a tabular format data to comma seperated data in KSH

Hi, Could anyone help me in changing a tabular format output to comma seperated file pls in K-sh. Its very urgent. E.g : username empid ------------------------ sri 123 to username,empid sri,123 Thanks, Hema:confused: (2 Replies)
Discussion started by: Hemamalini
2 Replies

2. 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

3. 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

4. Shell Programming and Scripting

help to compare data from file using shell script to c++ program

hello ....i am new in shell script..I have one shell script which read inputs from file...and second is c++ pgm..i call my script from c++ programm..to compare file values to c++ pgm value.. our shell script is shubhi.sh #! /bin/sh while read line do echo -e"$line" done<file1 this script... (1 Reply)
Discussion started by: shubhig15
1 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

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

7. Shell Programming and Scripting

Compare files with fields separated with semicolon

Dear experts I have files like ABD : 5869 events, relative ratio : 1.173800E-01 , sum of ratios : 1.173800E-01 VBD : 12147 events, relative ratio : 2.429400E-01 , sum of ratios : 3.603200E-01 SDF : 17000 events, relative ratio : 3.400000E-01 , sum of ratios : 7.003200E-01 OIP: 14984... (9 Replies)
Discussion started by: Alkass
9 Replies

8. Shell Programming and Scripting

Shell script to compare two files for duplicate..??

Hi , I had a requirement to compare two files whether the two files are same or different .... like(files contaisn of two columns each) file1.txt 121343432213 1234 64564564646 2345 343423424234 2456 file2.txt 121343432213 1234 64564564646 2345 31231313123 3455 how to... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

9. Shell Programming and Scripting

SUM semicolon-seperated values from txt-file

Hello, (I'm a shell beginner) how can I sum the bold values of the following txt-file (values.txt) with bash shell. The result of the sum should be written in a new txt file (sum.txt): ... Thanks in advance (5 Replies)
Discussion started by: milu
5 Replies

10. UNIX for Beginners Questions & Answers

Shell Script to Compare Files and Email the differences

Hi, I have 2 files abc.txt and bdc.txt. I am using $diff -y abc.txt bcd.txt -- compared the files side by side I would like to write a Shell Script to cmpare the files side by side and print the results( which are not matched) in a side by side format and save the results in another... (10 Replies)
Discussion started by: vasuvv
10 Replies
ifplugd.conf(5) 						File Formats Manual						   ifplugd.conf(5)

NAME
ifplugd.conf - ifplugd configuration file SYNOPSIS
/etc/ifplugd/ifplugd.conf DESCRIPTION
ifplugd.conf is the configuration file for ifplugd. It is a shell script that is sourced by the init script starting the daemon. It shall be used to set environment variables which are interpreted by the init script: OPTIONS
INTERFACES Specifies the ethernet interfaces to monitor. It has to contain a space seperated list of network interfaces names. Most users will probably use "eth0" here, however you may add additional interfaces for monitoring more than one device. A special value is sup- ported as well: "auto" will enable a more or less working auto detection of available network devices. This won't make you happy when using network module auto loading, since it cannot detect currently unloaded network devices. ARGS Additional command line arguments for ifplugd invocation. See ifplugd(8) for further information. ARGS_iface If specified for an interface this variable takes precedence over ARGS. This may be useful if more than one network device is present. SEE ALSO
ifplugd(8) COMMENTS
This man page was written using xmltoman(1) by Oliver Kurth. Manuals User ifplugd.conf(5)
All times are GMT -4. The time now is 04:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy