Hello
I have a ton of files in a directory of the format app.log.2008-04-04
I'd like to run a command that would archive each of these files as app.log.2008-04-04.tgz
I tried a few combinations of find with xargs etc but no luck.
Thanks
Amit (4 Replies)
This is my first post, please be nice. I have tried to google and read different tutorials.
The task at hand is:
Input file input.txt (example)
abc123defhij-E-1234jslo
456ujs-W-abXjklp
From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
Hi all,
I would like to ask whether in Unix shell/perl have any functions or command to allow grep/cat/read a file inside compressed .tgz without extract it?
I know we can tar tvf a compressed tgz but this only allow we read the path/filename contained inside the tarball. If we want to read... (3 Replies)
Hi,
I have already created the tar files. which consist of some log files and Audit.csv
plz see the below code for that
================================================
tar -Pczf ARCH/${arc_date}.tgz $LOG/*.log $REYE/CEP/FiAdapter/Audit.${arc_date}.csv
... (3 Replies)
I have hundreds of files to process. In each file
I need to look for a pattern then
extract value(s) from next line and then
search for value(s) selected from point (2) in the same file at a specific position.
HEADER ELECTRON TRANSPORT 18-MAR-98 1A7V
TITLE CYTOCHROME... (7 Replies)
Hey,
I have number of .tgz files and want to extract the file with the ending *results.txt from each one.
I have tried
for file in *.tgz; do tar --wildcards -zxf $file *results.txt; doneas well as
list=$(ls *.tgz)
for i in $list; do tar --wildcards -zxvf $i *.results.txt; done... (1 Reply)
I want to extract dates from the files and i have different types of files with pattern. I have list file with the patterns and want to date extract based on it in a sh script
Files in the directory :
file1_20160101.txt
file2_20160101_abc.txt
filexyz20160101.txt
list file with... (2 Replies)
Hello.
Here is a file contents :
declare -Ax NEW_FORCE_IGNORE_ARRAY=(="§" ="§" ="§" ="§" ="§" .................. ="§"Here is a pattern
=I want to extract 'NEW_FORCE_IGNORE_ARRAY' which is the whole word before the first occurrence of pattern '='
Is there a better solution than mine :... (3 Replies)
Discussion started by: jcdole
3 Replies
LEARN ABOUT MOJAVE
cpanplus::internals::extract5.18
CPANPLUS::Internals::Extract(3pm) Perl Programmers Reference Guide CPANPLUS::Internals::Extract(3pm)NAME
CPANPLUS::Internals::Extract - internals for archive extraction
SYNOPSIS
### for source files ###
$self->_gunzip( file => 'foo.gz', output => 'blah.txt' );
### for modules/packages ###
$dir = $self->_extract( module => $modobj,
extractdir => '/some/where' );
DESCRIPTION
CPANPLUS::Internals::Extract extracts compressed files for CPANPLUS. It can do this by either a pure perl solution (preferred) with the
use of "Archive::Tar" and "Compress::Zlib", or with binaries, like "gzip" and "tar".
The flow looks like this:
$cb->_extract
Delegate to Archive::Extract
METHODS
$dir = _extract( module => $modobj, [perl => '/path/to/perl', extractdir => '/path/to/extract/to', prefer_bin => BOOL, verbose => BOOL, force
=> BOOL] )
"_extract" will take a module object and extract it to "extractdir" if provided, or the default location which is obtained from your
config.
The file name is obtained by looking at "$modobj->status->fetch" and will be parsed to see if it's a tar or zip archive.
If it's a zip archive, "__unzip" will be called, otherwise "__untar" will be called. In the unlikely event the file is of neither format,
an error will be thrown.
"_extract" takes the following options:
module
A "CPANPLUS::Module" object. This is required.
extractdir
The directory to extract the archive to. By default this looks something like:
/CPANPLUS_BASE/PERL_VERSION/BUILD/MODULE_NAME
prefer_bin
A flag indicating whether you prefer a pure perl solution, ie "Archive::Tar" or "Archive::Zip" respectively, or a binary solution like
"unzip" and "tar".
perl
The path to the perl executable to use for any perl calls. Also used to determine the build version directory for extraction.
verbose
Specifies whether to be verbose or not. Defaults to your corresponding config entry.
force
Specifies whether to force the extraction or not. Defaults to your corresponding config entry.
All other options are passed on verbatim to "__unzip" or "__untar".
Returns the directory the file was extracted to on success and false on failure.
perl v5.18.2 2014-01-06 CPANPLUS::Internals::Extract(3pm)