Sponsored Content
Top Forums Shell Programming and Scripting Find file size difference in two files using awk Post 302498599 by bartus11 on Tuesday 22nd of February 2011 02:39:51 AM
Old 02-22-2011
Quote:
Originally Posted by royalibrahim
Thank you bartus, it worked perfectly. But, I cannot decode the logic. Could you please explain this to me?

Few doubts in this:
NR!=FNR --> this is needed because I told that counting of the lines may not be same in both the files? Or this is an indicator to parse the second file? If that so, this explicit indication is really needed to make awk to parse the 2nd file? Please clarify me.
You second guess is correct. NR==FNR means parsing 1st file, and NR!=FNR - second. It can be written differently thought:
Code:
'NR==FNR{a[$2]=$1;next}{a[$2]...

 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

Strange difference in file size when copying LARGE file..

Hi, Im trying to take a database backup. one of the files is 26 GB. I am using cp -pr to create a backup copy of the database. after the copying is complete, if i do du -hrs on the folders i saw a difference of 2GB. The weird fact is that the BACKUP folder was 2 GB more than the original one! ... (1 Reply)
Discussion started by: 0ktalmagik
1 Replies

2. Solaris

command to find out total size of a specific file size (spread over the server)

hi all, in my server there are some specific application files which are spread through out the server... these are spread in folders..sub-folders..chid folders... please help me, how can i find the total size of these specific files in the server... (3 Replies)
Discussion started by: abhinov
3 Replies

3. Emergency UNIX and Linux Support

to find difference between two files

I have a file which gets appended with records daily..for eg. 1st day of the month i get 9 records ,2nd day 9 records .....till the last day in the month...the no of records may vary...i store the previous days file in a variable oldfile=PATH/previousdaysfile....i store the current days file in a... (6 Replies)
Discussion started by: ganesh_248
6 Replies

4. Shell Programming and Scripting

find with file size and show the size

Hi All... is the below command be modified in sucha way that i can get the file size along with the name and path of the file the below command only gives me the file location which are more than 100000k...but I want the exact size of the file also.. find / -name "*.*" -size +100000k ... (3 Replies)
Discussion started by: rpraharaj84
3 Replies

5. UNIX for Dummies Questions & Answers

Find difference between two files

I have two files as below File1: a b c d File2: a b When i find the difference the output would be c&d.. How can i get my requirement...pls help... Many thanks in advance (10 Replies)
Discussion started by: jagadish_gaddam
10 Replies

6. Shell Programming and Scripting

Columns comparision of two large size files and printing the difference

Hi Experts, My requirement is to compare the second field/column in two files, if the second column is same in both the files then compare the first field. If the first is not matching then print the first and second fields of both the files. first file (a .txt) < 1210018971FF0000,... (6 Replies)
Discussion started by: krao
6 Replies

7. Shell Programming and Scripting

Find duplicate files by file size

Hi! I want to find duplicate files (criteria: file size) in my download folder. I try it like this: find /Users/frodo/Downloads \! -type d -exec du {} \; | sort > /Users/frodo/Desktop/duplicates_1.txt; cut -f 1 /Users/frodo/Desktop/duplicates_1.txt | uniq -d | grep -hif -... (9 Replies)
Discussion started by: Dirk Einecke
9 Replies

8. UNIX for Advanced & Expert Users

Find difference between 2 files

I have 2 files as follows. file1.txt <cell>123</cell> <cell>345</cell> file2.txt <cell>123</cell> <cell>456</cell> out out should be output.txt <cell>456></cell> How do we achieve this> The difference betwenn the two files should be wirtten to the output file.. ... (2 Replies)
Discussion started by: kanthrajgowda
2 Replies

9. Shell Programming and Scripting

To find difference between two files on a whole

Hi, The requirement is to compare two files that has single column of records each. Comparison is to happen on a whole and not line by line. File1.txt 314589929 315611087 304924413 315989094 301171509 302984393 315609549 314593632 File2.txt 315611087 304924413 315989094 (2 Replies)
Discussion started by: anandek
2 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
RDF::Trine::Parser(3pm) 				User Contributed Perl Documentation				   RDF::Trine::Parser(3pm)

NAME
RDF::Trine::Parser - RDF Parser class VERSION
This document describes RDF::Trine::Parser version 1.000 SYNOPSIS
use RDF::Trine::Parser; RDF::Trine::Parser->parse_url_into_model( $url, $model ); my $parser = RDF::Trine::Parser->new( 'turtle' ); $parser->parse_into_model( $base_uri, $rdf, $model ); $parser->parse_file_into_model( $base_uri, 'data.ttl', $model ); DESCRIPTION
RDF::Trine::Parser is a base class for RDF parsers. It may be used as a factory class for constructing parser objects by name or media type with the "new" method, or used to abstract away the logic of choosing a parser based on the media type of RDF content retrieved over the network with the "parse_url_into_model" method. METHODS
"media_type" Returns the canonical media type associated with this parser. "media_types" Returns the media types associated with this parser. "parser_by_media_type ( $media_type )" Returns the parser class appropriate for parsing content of the specified media type. "guess_parser_by_filename ( $filename )" Returns the best-guess parser class to parse a file with the given filename. "new ( $parser_name, @args )" Returns a new RDF::Trine::Parser object for the parser with the specified name (e.g. "rdfxml" or "turtle"). If no parser with the specified name is found, throws a RDF::Trine::Error::ParserError exception. Any @args will be passed through to the format-specific parser constructor. If @args contains the key-value pair "(canonicalize => 1)", literal value canonicalization will be attempted during parsing with warnings being emitted for invalid lexical forms for recognized datatypes. "parse_url_into_model ( $url, $model [, %args] )" Retrieves the content from $url and attempts to parse the resulting RDF into $model using a parser chosen by the associated content media type. If %args contains a 'content_cb' key with a CODE reference value, that callback function will be called after a successful response as: $content_cb->( $url, $content, $http_response_object ) "parse_into_model ( $base_uri, $data, $model [, context => $context] )" Parses the $data, using the given $base_uri. For each RDF statement parsed, will call "$model->add_statement( $statement )". "parse_file_into_model ( $base_uri, $fh, $model [, context => $context] )" Parses all data read from the filehandle or file $fh, using the given $base_uri. For each RDF statement parsed, will call "$model->add_statement( $statement )". "parse_file ( $base_uri, $fh, $handler )" Parses all data read from the filehandle or file $fh, using the given $base_uri. If $fh is a filename, this method can guess the associated parse. For each RDF statement parses $handler is called. "parse ( $base_uri, $rdf, &handler )" "new_bnode_prefix ()" Returns a new prefix to be used in the construction of blank node identifiers. If either Data::UUID or UUID::Tiny are available, they are used to construct a globally unique bnode prefix. Otherwise, an empty string is returned. BUGS
Please report any bugs or feature requests to through the GitHub web interface at <https://github.com/kasei/perlrdf/issues>. AUTHOR
Gregory Todd Williams "<gwilliams@cpan.org>" COPYRIGHT
Copyright (c) 2006-2012 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-06-29 RDF::Trine::Parser(3pm)
All times are GMT -4. The time now is 10:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy