I considered that as well. cp, at least some versions, allows to copy multiple input files to a target directory. That could be done like
It may overrun system limits if too many files are to be copied, though.
In a file a pattern is occured many times randomly. Even it may appear more then once in the same line too. How i can get the number of times that pattern appeared in the file? let the file name is abc.txt and the pattern is "xyz".
I used the following code:
grep -ic "xyz" abc.txt
but it is... (3 Replies)
one.txt
ONS.1287677000.820.log 20Oct2010
ONS.1287677000.123.log 21Oct2010
ONS.1287677000.456.log 22Oct2010
two.txt
ONS.1287677000.820.log:V AC CC EN
ONS.1287677000.123.log:V AC CC EN
ONS.1287677000.820.log:V AC CC EN
In file two.txt
i have to look for pattern which column one... (17 Replies)
I have an ugly conf file that has the string I'm interested in searching for in the middle of a block of code that's relevant, and I'm trying to find a way to remove that entire block based on the matched line.
I've googled for this problem, and most people helping are only interested in... (9 Replies)
would like to print word between matched patterns using sed
for example :
create INDEX SCOTT.OR_PK ON table_name(....)
would like to print between SCOTT. and ON which is OR_PK
Please help me out
Thanks (4 Replies)
Hi,
I have script like below:
#!/usr/local/bin/perl
use strict;
use warnings;
while (<DATA>) {
( my ($s_id) = /^\d+\|(\d+?)\|/ ) ;
if ( $s_id == 1 ){
s/^(.*\|)*.*ABC\.pi=(+|+)*.*ABC\.id=(\d+|+).*$/$1$2|$3/s;
print "$1$2|$3\n"; (2 Replies)
Hello every,
I am stuck in a problem. I have file like this. I want to add the fifth field of the match pattern line above the lines starting with "# @D". The delimiter is "|"
eg
>
# @D0.00016870300|0.05501020000|12876|12934|3||Qp||Pleistocene||"3 Qp Pleistocene"|Q
# @P... (5 Replies)
Hi,
I have two files file1.txt and file2.txt. Please see the attachments.
In file2.txt (which actually is a diff output between two versions of file1.txt.), I extract the pattern corresponding to 1172c1172. Now ,In file1.txt I have to search for this pattern 1172c1172 and if found, I have to... (9 Replies)
Hi,
I need to extract an info in $1 based on a matched pattern in $2,$3,$4, and $5.
The sample input file as follows:-
ID Pat1 Pat2 Pro1 use1
add41 M M M
add87 M M M M
add32 ... (16 Replies)
What I would like to do is if the lines with % have the same name, then combine the last 9 letters of the string underneath the last occurrence of that ID with the first 9 letters of the string underneath the first occurrence of that ID.
I have a file that looks like this:
%GOGG... (12 Replies)
Hi I want to print the line until pattern is matched.
I am using below code:
sed -n '1,/pattern / p' file
It is working fine for me , but its not working for exact match.
sed -n '1,/^LAC$/ p' file
Input:
LACC FEGHRA 0
LACC FACAF 0
LACC DARA 0
LACC TALAC 0
LAC ILACTC 0... (8 Replies)
Discussion started by: Abhisrajput
8 Replies
LEARN ABOUT PHP
phardata.extractto
PHARDATA.EXTRACTTO(3) 1 PHARDATA.EXTRACTTO(3)PharData::extractTo - Extract the contents of a tar/zip archive to a directory
SYNOPSIS
bool PharData::extractTo (string $pathto, [string|array $files], [bool $overwrite = false])
DESCRIPTION
Extract all files within a tar/zip archive to disk. Extracted files and directories preserve permissions as stored in the archive. The
optional parameters allow optional control over which files are extracted, and whether existing files on disk can be overwritten. The sec-
ond parameter files can be either the name of a file or directory to extract, or an array of names of files and directories to extract. By
default, this method will not overwrite existing files, the third parameter can be set to true to enable overwriting of files. This method
is similar to ZipArchive.extractTo(3).
PARAMETERS
o $pathto
- Path to extract the given files to
o $files
- The name of a file or directory to extract, or an array of files/directories to extract
o $overwrite
- Set to TRUE to enable overwriting existing files
RETURN VALUES
returns TRUE on success, but it is better to check for thrown exception, and assume success if none is thrown.
ERRORS /EXCEPTIONS
Throws PharException if errors occur while flushing changes to disk.
EXAMPLES
Example #1
A PharData.extractTo(3) example
<?php
try {
$phar = new PharData('myphar.tar');
$phar->extractTo('/full/path'); // extract all files
$phar->extractTo('/another/path', 'file.txt'); // extract only file.txt
$phar->extractTo('/this/path',
array('file1.txt', 'file2.txt')); // extract 2 files only
$phar->extractTo('/third/path', null, true); // extract all files, and overwrite
} catch (Exception $e) {
// handle errors
}
?>
SEE ALSO Phar.extractTo(3).
PHP Documentation Group PHARDATA.EXTRACTTO(3)