1)I am trying to write a script that works interactively lists duplicated records on certain field/column and asks user to delete one or more. And finally it deletes all the records the used has asked for.
I have an idea to store those line numbers in an array, not sure how to do this in... (3 Replies)
I have my data something like this
(08/03/2009 22:57:42.414)(:) king aaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbb
(08/03/2009 22:57:42.416)(:) John cccccccccccc cccccvssssssssss baaaaa
(08/03/2009 22:57:42.417)(:) Michael ddddddd tststststtststts
(08/03/2009 22:57:42.425)(:) Ravi... (11 Replies)
I have a log file and I am trying to run a script against it to search for key issues such as invalid users, errors etc. In one part, I grep for session closed and get a lot of the same thing,, ie. root username etc. I want to remove the multiple root and just have it do a count, like wc -l
... (5 Replies)
Hi All,
i need ti delete two duplicate processss which are running on the same device type (column 1) and port ID (column 2). here is the sample data
p1sc1m1 15517 11325 0 01:00:24 ? 0:00 scagntclsx25octtcp 2967 in3v mvmp01 0 8000 N S 969 750@751@752@
p1sc1m1 15519 11325 0 01:00:24 ? ... (5 Replies)
OK
I have two filelists......
The first is formatted like this....
/path/to/the/actual/file/location/filename.jpg
and has up to a million records
The second list shows filename.jpg where there is more then on instance.
and has maybe up to 65,000 records
I want to copy files... (4 Replies)
I do have a big CA bundle certificate file and each time if i get request to add new certificate to the existing bundle i need to make sure it is not present already. How i can validate the duplicates.
The alignment of the certificate within the bundle seems to be different.
Example:
Cert 1... (7 Replies)
Hi,
i have another problem. I have been trying to solve it by myself but failed.
inputfile
;;
ID T08578
NAME T08578
SBASE 30696
EBASE 32083
TYPE P
func just test
func chronology
func cholesterol
func null
INT 30765-37333
INT 37154-37318
Link 5546
Link 8142 (4 Replies)
Background: I use a TV tuner card to capture OTA video files (.mpeg) and then my Plex Media Server automatically optimizes the files (transcodes for better playback) and places them in a new directory. I have another Plex Library pointing to the new location for the optimized .mp4 files. This... (2 Replies)
I am using the below script to delete duplicate files but it is not working for directories with more than 10k files "Argument is too long" is getting for ls -t. Tried to replace ls -t with
find . -type f \( -iname "*.xml" \) -printf '%T@ %p\n' | sort -rg | sed -r 's/* //' | awk... (8 Replies)
Discussion started by: gold2k8
8 Replies
LEARN ABOUT OSX
io::file
IO::File(3pm) Perl Programmers Reference Guide IO::File(3pm)NAME
IO::File - supply object methods for filehandles
SYNOPSIS
use IO::File;
$fh = IO::File->new();
if ($fh->open("< file")) {
print <$fh>;
$fh->close;
}
$fh = IO::File->new("> file");
if (defined $fh) {
print $fh "bar
";
$fh->close;
}
$fh = IO::File->new("file", "r");
if (defined $fh) {
print <$fh>;
undef $fh; # automatically closes the file
}
$fh = IO::File->new("file", O_WRONLY|O_APPEND);
if (defined $fh) {
print $fh "corge
";
$pos = $fh->getpos;
$fh->setpos($pos);
undef $fh; # automatically closes the file
}
autoflush STDOUT 1;
DESCRIPTION
"IO::File" inherits from "IO::Handle" and "IO::Seekable". It extends these classes with methods that are specific to file handles.
CONSTRUCTOR
new ( FILENAME [,MODE [,PERMS]] )
Creates an "IO::File". If it receives any parameters, they are passed to the method "open"; if the open fails, the object is
destroyed. Otherwise, it is returned to the caller.
new_tmpfile
Creates an "IO::File" opened for read/write on a newly created temporary file. On systems where this is possible, the temporary file
is anonymous (i.e. it is unlinked after creation, but held open). If the temporary file cannot be created or opened, the "IO::File"
object is destroyed. Otherwise, it is returned to the caller.
METHODS
open( FILENAME [,MODE [,PERMS]] )
open( FILENAME, IOLAYERS )
"open" accepts one, two or three parameters. With one parameter, it is just a front end for the built-in "open" function. With two or
three parameters, the first parameter is a filename that may include whitespace or other special characters, and the second parameter
is the open mode, optionally followed by a file permission value.
If "IO::File::open" receives a Perl mode string (">", "+<", etc.) or an ANSI C fopen() mode string ("w", "r+", etc.), it uses the
basic Perl "open" operator (but protects any special characters).
If "IO::File::open" is given a numeric mode, it passes that mode and the optional permissions value to the Perl "sysopen" operator.
The permissions default to 0666.
If "IO::File::open" is given a mode that includes the ":" character, it passes all the three arguments to the three-argument "open"
operator.
For convenience, "IO::File" exports the O_XXX constants from the Fcntl module, if this module is available.
binmode( [LAYER] )
"binmode" sets "binmode" on the underlying "IO" object, as documented in "perldoc -f binmode".
"binmode" accepts one optional parameter, which is the layer to be passed on to the "binmode" call.
NOTE
Some operating systems may perform "IO::File::new()" or "IO::File::open()" on a directory without errors. This behavior is not portable
and not suggested for use. Using "opendir()" and "readdir()" or "IO::Dir" are suggested instead.
SEE ALSO
perlfunc, "I/O Operators" in perlop, IO::Handle, IO::Seekable, IO::Dir
HISTORY
Derived from FileHandle.pm by Graham Barr <gbarr@pobox.com>.
perl v5.16.2 2012-10-11 IO::File(3pm)