HI
I need to import data from a file which is in comressed format
but system doesn't have enough space to uncompress file
Is there any way so that i can do import from compressed file. (4 Replies)
Is there a way I can check if a file is comppressed or not? (Be it tar/gzip or compress). trying to write a generic housekeeping scrit that will delete files over 6 months old and compress any uncompressed files if less than 6 months old. But not sure if there is a clever way to check except for... (4 Replies)
I was wondering if there's a way to search within a file that's been compressed. i.e. if file a is inside file a.zip or a.gz, is there a a command that will retrieve the string of data I'm looking for in file a, and list which compressed file it found it in?
Please help!
Thanks. (8 Replies)
How we can view the content of the file,if it compressed (or) Zipped ,without uncompress ?
I have one file ,i compressed it,without uncompressing the file.Is it possible to see the content of the file? (2 Replies)
I simply need to compress all files in a directory that are not already compressed and that are older than 10 days?
I have this so far. I need to add to this so I don't try and compress file that are already compressed. Or if you think this can be simplified let me know. Thx.
find... (3 Replies)
Hi
i have a filename.tar.bz2 and i have to parse it with a tool that doesn't support compressed files.
I have to do it for many big files, so i can't decompress and then process. I'd like to do something like:
tar -jxvf namefile.tar.bz2 | parsing_tool
i mean analyze it directly,... (4 Replies)
How can I ensure the folder that I tar and compress is good to be archive in DVD or tape? Must I uncompress and untar the file, or there is any way to tell the integerity of the compressed file before send to archive? I have bad experience on this, which the archive compressed file cold not be... (2 Replies)
Hi All,
Is there is any way to find the size of compressed file without doing decompression. The size should give the original uncompressed data size
Thanks
Arun (3 Replies)
Hi,
I have a big (~15G) compressed file having around 170M records and I need to exclude around 4k bad records (\n in the string) .
The typical steps would have been
1. zgrep required records into new file
zgrep big15GFile.dat.gz > newBig64GFile.dat
2. zip back new file
gzip... (1 Reply)
Discussion started by: iamwha1am
1 Replies
LEARN ABOUT OSX
perldbmfilter
PERLDBMFILTER(1) Perl Programmers Reference Guide PERLDBMFILTER(1)NAME
perldbmfilter - Perl DBM Filters
SYNOPSIS
$db = tie %hash, 'DBM', ...
$old_filter = $db->filter_store_key ( sub { ... } );
$old_filter = $db->filter_store_value( sub { ... } );
$old_filter = $db->filter_fetch_key ( sub { ... } );
$old_filter = $db->filter_fetch_value( sub { ... } );
DESCRIPTION
The four "filter_*" methods shown above are available in all the DBM modules that ship with Perl, namely DB_File, GDBM_File, NDBM_File,
ODBM_File and SDBM_File.
Each of the methods works identically, and is used to install (or uninstall) a single DBM Filter. The only difference between them is the
place that the filter is installed.
To summarise:
filter_store_key
If a filter has been installed with this method, it will be invoked every time you write a key to a DBM database.
filter_store_value
If a filter has been installed with this method, it will be invoked every time you write a value to a DBM database.
filter_fetch_key
If a filter has been installed with this method, it will be invoked every time you read a key from a DBM database.
filter_fetch_value
If a filter has been installed with this method, it will be invoked every time you read a value from a DBM database.
You can use any combination of the methods from none to all four.
All filter methods return the existing filter, if present, or "undef" if not.
To delete a filter pass "undef" to it.
The Filter
When each filter is called by Perl, a local copy of $_ will contain the key or value to be filtered. Filtering is achieved by modifying the
contents of $_. The return code from the filter is ignored.
An Example: the NULL termination problem.
DBM Filters are useful for a class of problems where you always want to make the same transformation to all keys, all values or both.
For example, consider the following scenario. You have a DBM database that you need to share with a third-party C application. The C
application assumes that all keys and values are NULL terminated. Unfortunately when Perl writes to DBM databases it doesn't use NULL
termination, so your Perl application will have to manage NULL termination itself. When you write to the database you will have to use
something like this:
$hash{"$key "} = "$value ";
Similarly the NULL needs to be taken into account when you are considering the length of existing keys/values.
It would be much better if you could ignore the NULL terminations issue in the main application code and have a mechanism that
automatically added the terminating NULL to all keys and values whenever you write to the database and have them removed when you read from
the database. As I'm sure you have already guessed, this is a problem that DBM Filters can fix very easily.
use strict;
use warnings;
use SDBM_File;
use Fcntl;
my %hash;
my $filename = "filt";
unlink $filename;
my $db = tie(%hash, 'SDBM_File', $filename, O_RDWR|O_CREAT, 0640)
or die "Cannot open $filename: $!
";
# Install DBM Filters
$db->filter_fetch_key ( sub { s/ $// } );
$db->filter_store_key ( sub { $_ .= "