I need to extract certain pieces from a string, wher delimiters may vary. For example
A0 B0 C0 12345677 X0 Y0 Z0
A1-B1 C1 12345678 X1 Y0 Z0
A1/B2 C77 12345679 X2 Y0 Z0
I need to get
C0 12345677 X0
C1 12345678 X1
C77 12345679 X2
I tried sed, see example below:
echo 'A0 B0... (2 Replies)
I have a line of text for example
aaaa bbbb cccc dddd eeee ffffff
I would need to get the cccc however bbbb could be there or not.
So whether bbbb is in the line or not I need cccc.
I was looking at either awk or sed....and trying to start at c and end until the next space.
Also... (11 Replies)
Good afternoon!
I have an XML file from which I want to extract only certain elements contained within each line. The problem is that the format of each line is not exactly the same (though similiar). For example, oa_var will be in each line, however, there may be no value or other... (3 Replies)
Basically , i want to delete strings of a particular pattern from the flat file which is " | " pipe delimited.
Below are the valid formats :
1) AAA (0) 111-111-111, AAA, BB
2) AAA (0) 111-111-1111;X, AAA, BB
original flat file example :
|ABC ABC XHAMK|AAA (0) 111-111-111, AAA,... (3 Replies)
Hi All,
i have file name like below
ABC_065224_123456_123456_your_130413_163005.txt
ABC_065224_123456_MAIN_20130413_163005.txt
ABC_065224_123456_123456_MAIN_130413_163005.txt
ABC_065224_123456_123456_434567_MAIN_130413_163005.txt
i need to find out the number of characters in the filed... (6 Replies)
Hi All,
I'm stuck-up in finding a way to skip the delimiter which come within double quotes using awk or any other better option. can someone please help me out.
Below are the details:
Delimited: |
Sample data: 742433154|"SYN|THESIS MED CHEM PTY.... (2 Replies)
Hello,
I would need to replace a delimiter in a flat file using.I would like to replace the semicolon (";") but only if it was contained in a string between quotes. For example:
Original flat file example:
abc;abc;"abc;abc";cd;"ef;ef";abc
aa;bb;"aa";cc;"ddd;eee";ff
Desired output:... (9 Replies)
Discussion started by: bartleby
9 Replies
LEARN ABOUT MOJAVE
ppi::token::regexp
PPI::Token::Regexp(3) User Contributed Perl Documentation PPI::Token::Regexp(3)NAME
PPI::Token::Regexp - Regular expression abstract base class
INHERITANCE
PPI::Token::Regexp
isa PPI::Token
isa PPI::Element
DESCRIPTION
The "PPI::Token::Regexp" class is never instantiated, and simply provides a common abstract base class for the three regular expression
classes. These being:
m// - PPI::Token::Regexp::Match
s/// - PPI::Token::Regexp::Substitute
tr/// - PPI::Token::Regexp::Transliterate
The names are hopefully obvious enough not to have to explain what each class is. See their pages for more details.
To save some confusion, it's worth pointing out here that "qr//" is not a regular expression (which PPI takes to mean something that will
actually examine or modify a string), but rather a quote-like operator that acts as a constructor for compiled Regexp objects.
METHODS
The following methods are inherited by this class' offspring:
get_match_string
The "get_match_string" method returns the portion of the regexp that performs the match.
get_substitute_string
The "get_substitute_string" method returns the portion of the regexp that is substituted for the match, if any. If the regexp does not
substitute, "undef" is returned.
get_modifiers
The "get_modifiers" method returns the modifiers of the regexp.
get_delimiters
The "get_delimiters" method returns the delimiters of the regexp as an array. The first element is the delimiters of the match string, and
the second element (if any) is the delimiters of the substitute string (if any).
SUPPORT
See the support section in the main module.
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Copyright 2001 - 2011 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.18.2 2011-02-25 PPI::Token::Regexp(3)