So, this issue is driving me nuts! I was hoping to get a lending hand here...
I have 2 files:
file1.txt contains:
this is example1
this is example2
this is example3
this is example4
this is example5
file2.txt contains:
example3
example5
Basically, I need a script or command to... (4 Replies)
All,
Below is the file, what i need to do is take the text in between the /*-- and --*/ , i mean the jobs. Then i have grep for system name . If the job is there in system 1 i have to print to a file.
Basically i want to take all the jobs that are in system1 to another file . because... (7 Replies)
Hi,
I have a file with fields like below:
A;XYZ;102345;222
B;XYZ;123243;333
C;ABC;234234;444
D;MNO;103345;222
E;DEF;124243;333
desired output:
C;ABC;234234;444
D;MNO;103345;222
E;DEF;124243;333
ie, if the 4rth field is a duplicate.. i need only those records where... (5 Replies)
Hi
I need to select lines from a txt file, I have got a line starting with ZMIO:MSISDN= and after a few line I have another line starting with 'MOBILE STATION ISDN NUMBER' and another one starting with 'VLR-ADDRESS' I need to copy these three lines as three different columns in a separate... (3 Replies)
Hi, I have multiple large files which consist of the below format:
I am trying to write an awk or sed script to remove all occurrences of the 00 record except the first and remove all of the 80 records except the last one.
Any help would be greatly appreciated. (10 Replies)
Gurus,
I am relatively new to Unix scripting and am struck with a problem in my script. I have positional input file which has a FLAG indicator in at position 11 in every record of the file.
If the Flag has value =Y, then the record from the input needs to be written to a new file.However if... (3 Replies)
Hi Guru's,
I am new to unix scripting. I have a huge file with user details in it(file2) and I have another file with a list of users(file1). Script has to search a user from file1 and get all the associated lines from file2.
Example:
fiel1:
cn=abc
cn=DEF
cn=xyx
File 2:
dn:... (10 Replies)
Dear community,
I have to remove duplicate lines from a file contains a very big ammount of rows (milions?) based on 1st and 3rd columns
The data are like this:
Region 23/11/2014 09:11:36 41752
Medio 23/11/2014 03:11:38 4132
Info 23/11/2014 05:11:09 4323... (2 Replies)
Trying to match $1 of target.txt to $5 of file.txt. If there is a match then in an output.txt file $1,$1 (row underneath),$6,$4,$7 from file.txt are printed on the same line as $1 of target.txt. The input is from excel and the output should be tab-deliminated. Thank you :).
target.txt... (2 Replies)
Discussion started by: cmccabe
2 Replies
LEARN ABOUT DEBIAN
path::class::file::stat
Path::Class::File::Stat(3pm) User Contributed Perl Documentation Path::Class::File::Stat(3pm)NAME
Path::Class::File::Stat - cache and compare stat() calls on a Path::Class::File object
SYNOPSIS
use Path::Class::File::Stat;
my $file = Path::Class::File::Stat->new('path','to','file');
# $file has all the magic of Path::Class::File
# sometime later
if ($file->changed)
{
# do something provocative
}
DESCRIPTION
Path::Class::File::Stat is a simple extension of Path::Class::File. Path::Class::File::Stat is useful in long-running programs (as under
mod_perl) where you might have a file handle opened and want to check if the underlying file has changed.
METHODS
Path::Class::File::Stat extends Path::Class::File objects in the following ways.
use_md5
Calling this method will attempt to load Digest::MD5 and use that instead of stat() for creating file signatures. This is similar to how
File::Modified works.
changed
Returns the previously cached File::stat object if the file's device number and inode number have changed, or if the modification time or
size has changed.
Returns 0 (false) otherwise.
While File::Modified uses a MD5 signature of the stat() of a file to determine if the file has changed, changed() uses a simpler (and
probably more naive) algorithm. If you need a more sophisticated way of determining if a file has changed, use the restat() method and
compare the cached File::stat object it returns with the current File::stat object.
Example of your own changed() logic:
my $oldstat = $file->restat;
my $newstat = $file->stat;
# compare $oldstat and $newstat any way you like
Or just use File::Modified instead.
restat
Re-cache the File::stat object in the Path::Class::File::Stat object. Returns the previously cached File::stat object.
The changed() method calls this method internally if changed() is going to return true.
SEE ALSO
Path::Class, Path::Class::File, File::Signature, File::Modified
AUTHOR
Peter Karman, <karman@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2006 by Peter Karman
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-01-28 Path::Class::File::Stat(3pm)