Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Comparison of 2 files in UNIX Post 302145207 by bakunin on Tuesday 13th of November 2007 07:40:32 AM
Old 11-13-2007
Quote:
Originally Posted by kahuna
So, without order by, the same query executed twice could, theoretically, return the same records in two totally different orders.
True. Even if the files are not ordered it would be possible to pipe them through "sort" (man sort) to get them sorted prior to searching them. This would limit the search-effort too, because at some point one could be sure that no matching record will follow.

bakunin
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix comparison

I am very new to Unix. What are the similiarities and differences between ScoUnix and AIX5 if any? Where might i find the information? Which is better? (1 Reply)
Discussion started by: NewGuy100
1 Replies

2. Shell Programming and Scripting

comparison of 2 files

Kindly help on follows. I have 2 files. One file contains only one column of mobile numbers. And total records in a file 12 million. Second file contains 2 columns mobile numbers and balance. and total records 30 million. I want to find out balance of each data in file 1 corresponding to file 2.... (2 Replies)
Discussion started by: kamal_418
2 Replies

3. Shell Programming and Scripting

Comparison of two files (sh)

Hi, I have a problem with comparison of two files file1 20100101 20090101 20080101 20071001 20121229 file2 19990112 12 456 7 20011131 19 20100101 2 567 1 987 17890709 123 555 and, sh script needs to compare of these two files and give out to me result: 20100101 2 567 1 987 it... (5 Replies)
Discussion started by: shizik
5 Replies

4. Shell Programming and Scripting

comparison of 2 files using unix or awk

Hello, I have 2 files and I want them to be compared in a specific fashion file1: A_1200_1250 A_1251_1300 B_1301_1350 B_1351_1400 B_1401_1450 C_1451_1500 and so on... file2: 1210 1305 1260 1295 1400 1500 1450 1495 Now The script should look for "1200" from A_1200_1250 of... (8 Replies)
Discussion started by: Diya123
8 Replies

5. Shell Programming and Scripting

Comparison of two files

Hi all I have two files which I have to compare that whetehr there is soemthing common or not body, div, table, thead, tbody, tfoot, tr, th, td, p { font-family: "Liberation Sans"; font-size: x-small; } body, div, table, thead, tbody, tfoot,... (2 Replies)
Discussion started by: manigrover
2 Replies

6. Shell Programming and Scripting

File comparison in UNIX columnwise

Hi all, I want to compare two files with same number of rows and columns with records in same order. Just want to highlight the differences in the column values if any. file A 1,kolkata,19,ab 2,delhi,89,cd 3,bangalore,56,ef file2: 1,kolkata,21,ab 2,mumbai,89,gh 3,bangalore,11,kl... (9 Replies)
Discussion started by: prabhat.diwaker
9 Replies

7. Shell Programming and Scripting

Comparison between two files through UNIX script

Hi All , As I am new to unix scripting ,I need a help regarding unix scripting .I have two .txt files .One is source file and another is target file.I need a script through which I can compare those two files.I need a automated comparison report in a directory after comparing between source &... (2 Replies)
Discussion started by: STCET22
2 Replies

8. Shell Programming and Scripting

Need help regarding comparison between two files through UNIX script

Hi All , I am aware of unix command ,but not comforable in putting together in script level.I came to situation where I need to compare between two .txt files fieldwise and need a mismatch report. As I am new to unix script arena ,if anyone can help in the below scenario that will be really... (9 Replies)
Discussion started by: STCET22
9 Replies

9. Shell Programming and Scripting

UNIX file comparison

I have two files which has component name and version number separated by a space cat file1 com.acc.invm:FNS_PROD 94.0.5 com.acc.invm:FNS_TEST_DCCC_Mangment 94.1.6 com.acc.invm:FNS_APIPlat_BDMap 100.0.9 com.acc.invm:SendEmail 29.6.113 com.acc.invm:SendSms 12.23.65 cat file2 ... (8 Replies)
Discussion started by: rakeshtomar82
8 Replies

10. Shell Programming and Scripting

Comparison of files

I have the requirement I have two files cat fileA something anythg nothing everythg cat fileB everythg anythg Now i shld use fileB and compare every line at fileA and get the output as something nothing (3 Replies)
Discussion started by: Priya Amaresh
3 Replies
SORT-DCTRL(1)						       Debian user's manual						     SORT-DCTRL(1)

NAME
sort-dctrl - sort Debian control files SYNOPSIS
sort-dctrl [options] [ file ... ] sort-dctrl --copying | --help | --version | -ChV DESCRIPTION
The sort-dctrl program sorts Debian control files according to specified criteria. A Debian control (dctrl) file is a semistructured single-table database stored in a machine-parseable text file. Such a database consists of a set of records; each record is a mapping from field names to field content. Textually, records are separated by empty lines, while each field is encoded as one or more nonempty lines inside a record. A field starts with its name, followed by a colon, followed by the field content. The colon must reside on the first line of the field, and the first line must start with no whitespace. Subsequent lines, in contrast, always start with linear whitespace (one or more space or tab characters). The sort-dctrl program recognizes two field types: string fields and version fields. Version fields act also as numeric fields. String fields are compared according to strict lexicographical octet-by-octet comparison, after ignoring any initial whitespace after the colon. Version fields are parsed and compared as Debian version numbers. When comparing version numbers, if a field content does not in fact con- form to the version number syntax, it compares less than any field content that does conform, and equal to any other nonconforming field content. The sort-dctrl program assumes all fields are string fields unless told otherwise. You can specify arbitrary number of keys for sorting, using the -k option. The keys are interpreted in a descending order of priority: the first key specified is primary, the second key specified is secondary, and so on. If two records compare equal under the primary key, then they are compared under the secondary key, and so on. If no keys are specified, a default key is assumed (the "Package" field with no mod- ifiers). OPTIONS
-k keyspec, --key-spec=keyspec Specify one or more keys for sorting. You may specify this option any number of times. The keyspec argument consists of a comma- separated list of key specifications. Each key specification consists of the name of the field that serves as the key, optionally followed by a colon and key modifiers. The following key modifiers are supported: r Invert the comparison for this key, reversing the sorting order. v Treat this field as a version number field. n Treat this field as numeric, which currently is synonymous with v. -q, --quiet, --silent Output nothing to the standard output stream. Instead, exit immediately after finding the first match. -l level, --errorlevel=level Set log level to level. level is one of fatal, important, informational and debug, but the last may not be available, depending on the compile-time options. These categories are given here in order; every message that is emitted when fatal is in effect, will be emitted in the important error level, and so on. The default is important. -V, --version Print out version information. -C, --copying Print out the copyright license. This produces much output; be sure to redirect or pipe it somewhere (such as your favourite pager). -h, --help Print out a help summary. EXAMPLES
Here are some sample invocations of the program: sort-dctrl /var/lib/dpkg/available Output the dpkg available file sorted by the package name. sort-dctrl -k Version:v /var/lib/dpkg/available Output the dpkg available file sorted in ascending order of version numbers. sort-dctrl -k Version:vr /var/lib/dpkg/available Output the dpkg available file sorted in descending order of version numbers. sort-dctrl -k Package,Version:v /var/lib/dpkg/available Output the dpkg available file sorted primarily in ascending order of package names and secondarily in descending order of version numbers. sort-dctrl -k Installed-Size:n,Size:nr /var/lib/dpkg/available Output the dpkg available file sorted primarily in ascending order of installation sizes and secondarily in descending order of package sizes. AUTHOR
The program and this manual page were written by Antti-Juhani Kaijanaho <ajk@debian.org>. SEE ALSO
Debian Policy Manual. Published as the Debian package debian-policy. Also available in the Debian website. grep-dctrl(1) Debian Project 2005-06-08 SORT-DCTRL(1)
All times are GMT -4. The time now is 09:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy