Sponsored Content
Top Forums Shell Programming and Scripting Problem updated file with new entries Post 302367061 by edidataguy on Saturday 31st of October 2009 09:48:00 PM
Old 10-31-2009
Is this a homework?
Because good programmer will not take this approach.
Usually you come up with an employee ID.
This will be a disaster if there were more than one employee with the same name.

Master file1:
Code:
Jack  Jim
Tom   Tim
Red   Rose
Steve Stan
Jack  John

Data file2:
Code:
Jack
Tom
Jack
Red
Steve
Jack

All the Jack's will be replaced with John (being the last entry in file1).
Jim will be nowhere in the picture.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating an updated file

Hi, I would like to define a script in order to update a file with the last updated records: I wrote : #!/bin/sh YEAR=$(date +%Y) MONTH=$(date +%m) DAY=$(date +%d) COMM=/usr/bin/comm for file in * ; do if ] ; then FILE=${DPSTY} UNIQUE=Unique_${FILE} ... (4 Replies)
Discussion started by: dbfree
4 Replies

2. Solaris

which file is updated after modified the crontab entries.

Hi all, i want to know which file is updated after changes the modifications/new entries in crontab. Please help regarding this. regards Krishna (1 Reply)
Discussion started by: krishna176
1 Replies

3. UNIX for Dummies Questions & Answers

Find last updated file

Hi all, my problem is teh following: I need to move a file from a folder to another and I usually do it by the get command but in this case I have a list of file in the source folder and I have to select only the lust updated one. Ho to do this? All the files have the same name followed... (4 Replies)
Discussion started by: callimaco0082
4 Replies

4. Programming

Log file not getting updated

hi all, i'm a student and managing lab at my insti. there in one application in which log file has to be maintaine the number of bytes transferred and received. but after certain entries these two attributes stop getting updated and holds same values for rest of the session. This happens one time... (4 Replies)
Discussion started by: KornFire
4 Replies

5. Shell Programming and Scripting

If File has been updated, do something??

Put this together from somewhere else on the forums, just modified it and added the loop. #!/bin/ksh localFile=$1 remoteFile=$2 #source FTP parameters . .ftp_put.cfg mylog=ftp_session.log echo "$(date "+%H:%M:%S") - Attempt to FTP $1 to $2" > $mylog machine="server1 server2... (5 Replies)
Discussion started by: cbo0485
5 Replies

6. Shell Programming and Scripting

Script to wait until file is updated

Hello, I need to evaluate (under BASH) if the certain file has been updated or not. If the file still wasn't updated, script should wait. The script picks up the time stamp of the file using command OldTimestamp=$(date -r $MyDir/$MyFile), but I don't know how to code a waiting loop with new and... (6 Replies)
Discussion started by: sameucho
6 Replies

7. Shell Programming and Scripting

trying to check if the file is getting updated or not

#!/bin/sh #set -x Current_Date=`date +"%b %e"` Filepmdate=`ls -ltr /file/ | tail -5 | awk '{print $6,$7}'` if ; then echo " " exit 0 else echo "Log files are not updated please check" exit 0 fi done > sh -x l12.sh + + date +%b %e Current_Date=Aug... (2 Replies)
Discussion started by: arch12
2 Replies

8. Shell Programming and Scripting

Search for a recently updated file

Hi, I am looking for a command to search for a specific file which was recently modified in the current directory leaving some unwanted files to be listed. For example, when I try ls - lrt it shows the following output. I want to ommit the files with the name 'resend' and... (3 Replies)
Discussion started by: svajhala
3 Replies

9. Shell Programming and Scripting

Is there any command to know what updated last in file?

Is there any command to know what updated last in file? (3 Replies)
Discussion started by: anuragpgtgerman
3 Replies

10. UNIX for Dummies Questions & Answers

Copy the last part since the file has been updated

Input File1 constatntly running and growing in size. My Program Erorr ddmmyy hh:mm:ss My Program Error **Port 123 terminated **ID PIN 12345 Comamnd Successful Command Terminated Command Successful Command Terminated **My Program Erorr ddmmyy hh:mm:ss My Program Error **Port 345... (3 Replies)
Discussion started by: eurouno
3 Replies
Mail::Field(3)						User Contributed Perl Documentation					    Mail::Field(3)

NAME
Mail::Field - Base class for manipulation of mail header fields INHERITANCE
Mail::Field is extended by Mail::Field::AddrList Mail::Field::Date Mail::Field::Generic SYNOPSIS
use Mail::Field; my $field = Mail::Field->new('Subject', 'some subject text'); my $field = Mail::Field->new(Subject => 'some subject text'); print $field->tag,": ",$field->stringify," "; my $field = Mail::Field->subject('some subject text'); DESCRIPTION
"Mail::Field" creates and manipulates fields in MIME headers, collected within a Mail::Header object. Different field types have their own sub-class (extension), defining additional useful accessors to the field content. People are invited to merge their implementation to special fields into MailTools, to maintain a consistent set of packages and documentation. METHODS
Constructors Mail::Field (and it's sub-classes) define several methods which return new objects. These can all be categorized as constructor. Mail::Field->combine(FIELDS) Take a LIST of "Mail::Field" objects (which should all be of the same sub-class) and create a new object in that same class. Mail::Field->extract(TAG, HEAD [, INDEX ]) Takes as arguments the tag name, a "Mail::Head" object and optionally an index. If the index argument is given then "extract" will retrieve the given tag from the "Mail::Head" object and create a new "Mail::Field" based object. undef will be returned in the field does not exist. If the index argument is not given the result depends on the context in which "extract" is called. If called in a scalar context the result will be as if "extract" was called with an index value of zero. If called in an array context then all tags will be retrieved and a list of "Mail::Field" objects will be returned. Mail::Field->new(TAG [, STRING | OPTIONS]) Create an object in the class which defines the field specified by the TAG argument. "Fake" constructors $obj->create(OPTIONS) This constructor is used internally with preprocessed field information. When called on an existing object, its original content will get replaced. $obj->parse() Parse a field line. Accessors $obj->set(OPTIONS) Change the settings (the content, but then smart) of this field. $obj->stringify() Returns the field as a string. $obj->tag() Mail::Field->tag() Return the tag (in the correct case) for this item. Well, actually any casing is OK, because the field tags are treated case- insensitive; however people have some preferences. Smart accessors $obj->text([STRING]) Without arguments, the field is returned as stringify() does. Otherwise, the STRING is parsed with parse() to replace the object's content. It is more clear to call either stringify() or parse() directly, because this method does not add additional processing. DETAILS
SUB-CLASS PACKAGE NAMES All sub-classes should be called Mail::Field::name where name is derived from the tag using these rules. o Consider a tag as being made up of elements separated by '-' o Convert all characters to lowercase except the first in each element, which should be uppercase. o name is then created from these elements by using the first N characters from each element. o N is calculated by using the formula :- int((7 + #elements) / #elements) o name is then limited to a maximum of 8 characters, keeping the first 8 characters. For an example of this take a look at the definition of the "_header_pkg_name()" subroutine in "Mail::Field" DIAGNOSTICS
Error: Undefined subroutine <method> called Mail::Field objects use autoloading to compile new functionality. Apparently, the method called is not implemented for the specific class of the field object. SEE ALSO
This module is part of the MailTools distribution, http://perl.overmeer.net/mailtools/. AUTHORS
The MailTools bundle was developed by Graham Barr. Later, Mark Overmeer took over maintenance without commitment to further development. Mail::Cap by Gisle Aas <aas@oslonett.no>. Mail::Field::AddrList by Peter Orbaek <poe@cit.dk>. Mail::Mailer and Mail::Send by Tim Bunce <Tim.Bunce@ig.co.uk>. For other contributors see ChangeLog. LICENSE
Copyrights 1995-2000 Graham Barr <gbarr@pobox.com> and 2001-2007 Mark Overmeer <perl@overmeer.net>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.18.2 2014-01-05 Mail::Field(3)
All times are GMT -4. The time now is 08:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy