Another enigma (for me)
Using VI I edit some files in which I want to erase many lines I don't need anymore
usually I do something like that::%s/line_to_suppress//g
and it is doing fine
but in this case, the pattern to erase contains some special characters
so I do it like... (9 Replies)
well i have this file here:
<XML>
<pregate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<system_c>HPREGATE</system_c>
<trans_c>HSPG</trans_c>
<trans_dt>20060105161333</trans_dt>
<user_id_m></user_id_m>
<func_c>C</func_c>
</pregate>
</XML>
i want to... (2 Replies)
I know in vi you can do
:%s/replaceme/withthis/
but if i want to find all lines say without a # at the begining and I want to put it in how would that command be formatted? I can't figure it out for the life of me.
#comment
blah1
hey1
grrr1
#comment
#blah1
#hey1
#grrr1 (5 Replies)
Hi,
I have query terms like this:
a) apple bannana
b) apple bannana AND chickko
c) "milk shake" OR Graphes orange
whereever there is space substitue with AND operator.
I tried like this: (2 Replies)
My question is how would I substitute for ceratain number of occurences in a line? If this is my input
rjohns BFSTDBS01 Standard Silver NPRO30DINCR 2 Client
Is it possible to change the first 3 occurences of space " " to a comma? (7 Replies)
Hi gurus,
I need help with shell script. I have various INSERT queries which inserts data into database. I want to insert 3rd column data into newline for one particular table. I have very time long txt file everytime and it have various INSERT/UPDATE queries but i have to done with it only one... (8 Replies)
using awk to substitute data in a column delimited text file
hello i would like to use awk to do the following calculation from the following snippet.
input file
C;2390 ;CV BOUILLOTTE 2L 2FACES NERVUREES ;1.00 ;3552612239004;13417 ;25 ;50 ; 12;50000 ; ; ... (3 Replies)
I usually use :
Code:
awk '{gsub(/xxx/,"yyy");print}'
to substitute xxx with yyy.
I have a problem substitute an expression like
Code:
x ' y
Because of the ( ' )
Any idea on how to get over this problem?
Thanks (2 Replies)
Hi there,
i am updating a file on UNIX and have many lines as per below :
listen:x:37:4:Network Admin:/usr/net/nls:
i would like to substitute from the :/usr to the end of the line.
so at the moment im using this :
:s/"\/$/ /g
but i get an error.can anyone help?
thank you (3 Replies)
I need to substitute only comma with dot in string like this:
<strong>5,4</strong>but not sure how to do this.
This does not work:
text = sub('<strong>(,)</strong>', '<strong>(.)</strong>', text) (1 Reply)
Discussion started by: TiedCone
1 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)