Hi,
I have file 1.txt with following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433
**
**
**
In file 2.txt I have the following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433... (4 Replies)
Hi all,
I'm looking for some help. I have a file (very long) that is organized like below:
>Cluster 0
0 283nt, >01_FRYJ6ZM12HMXZS... at +/99%
1 279nt, >01_FRYJ6ZM12HN12A... at +/99%
2 281nt, >01_FRYJ6ZM12HM4TS... at +/99%
3 283nt, >01_FRYJ6ZM12HM946... at +/99%
4 279nt,... (4 Replies)
I have a file a file having entries are like
@ram@sham@sita
@krishan@kumar
@deep@kumar@hello@sham
in this file all line are having different no of pattern-@.
need to fetch the substring after the last pattern.
like
sita
kumar
sham
thanks in advance (3 Replies)
Hi,
I have a string looks like the following:
USERS 32767.9844 UNDOTBS1 32767.9844 SYSAUX 32767.9844 SYSTEM 32767.9844 EMS 8192 EMS 8192 EMS_INDEXES 4096 EMS_INDEXES 4096 8 rows selected.
How do I extract a sub-string to get the expected output as following:
EMS 8192
EMS_INDEXES 4096
... (3 Replies)
Fairly straightforward, but I'm having an awful time getting what I thought was a simple regex to work. I'll give the command I was playing with, and I'm aware why this one doesn't work (the 1,3 is off the A-Z, not the whole expression), I just don't know what the fix is:
Actual Output(s):
$... (5 Replies)
Hi All,
I have the following output file created as a result of one script called pattern_daily.log
$ cat pattern_daily.log
Approved|2|Wed, Oct 24, 2012 11:21:09 AM
Declined|1|Wed, Oct 24, 2012 11:21:15 AM
Approved|2|Wed, Oct 24, 2012 11:24:08 AM
Declined|1|Wed, Oct 24, 2012 11:24:18 AM... (4 Replies)
'Hi
I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match.
Which option is to be used to exclude the line containing the pattern?
sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
I am not an expert with linux, but following various posts on this forum, I have been trying to write a script to match pattern of charters occurring together in a file.
My file has approximately 200 million characters (upper and lower case), with about 50 characters per line. I have merged all... (5 Replies)
Hi,
I know how to replace a string with another in a file.
But, i wish to replace the below string pattern
EncryptedPassword="{gafgfa}]\asffafsf312a" i.e EncryptedPassword="<any random string>"
To
EncryptedPassword=""
i.e remove the random password to a empty string.
Can you... (3 Replies)
Discussion started by: mohtashims
3 Replies
LEARN ABOUT PHP
regexiterator
REGEXITERATOR(3) 1 REGEXITERATOR(3)The RegexIterator classINTRODUCTION
This iterator can be used to filter another iterator based on a regular expression.
CLASS SYNOPSIS
RegexIterator
RegexIteratorextends
FilterIterator
Constants
o const integer$MATCH0
o const integer$GET_MATCH1
o const integer$ALL_MATCHES2
o const integer$SPLIT3
o const integer$REPLACE4
o const integer$USE_KEY1
Methods
o public RegexIterator::__construct (Iterator $iterator, string $regex, [int $mode = self::MATCH], [int $flags], [int $preg_flags])
o public bool RegexIterator::accept (void )
o public int RegexIterator::getFlags (void )
o public int RegexIterator::getMode (void )
o public int RegexIterator::getPregFlags (void )
o public string RegexIterator::getRegex (void )
o public void RegexIterator::setFlags (int $flags)
o public void RegexIterator::setMode (int $mode)
o public void RegexIterator::setPregFlags (int $preg_flags)
Inherited methods
o publicabstract bool FilterIterator::accept (void )
o public FilterIterator::__construct (Iterator $iterator)
o public mixed FilterIterator::current (void )
o public Iterator FilterIterator::getInnerIterator (void )
o public mixed FilterIterator::key (void )
o public void FilterIterator::next (void )
o public void FilterIterator::rewind (void )
o public bool FilterIterator::valid (void )
PREDEFINED CONSTANTS REGEXITERATOR OPERATION MODES
o RegexIterator::ALL_MATCHES - Return all matches for the current entry (see preg_match_all(3)).
o RegexIterator::GET_MATCH - Return the first match for the current entry (see preg_match(3)).
o RegexIterator::MATCH - Only execute match (filter) for the current entry (see preg_match(3)).
o RegexIterator::REPLACE - Replace the current entry (see preg_replace(3); Not fully implemented yet)
o RegexIterator::SPLIT - Returns the split values for the current entry (see preg_split(3)).
REGEXITERATOR FLAGS
o RegexIterator::USE_KEY - Special flag: Match the entry key instead of the entry value.
PHP Documentation Group REGEXITERATOR(3)