hi
i have the following function, reading file line by line,
if line contains "Change state" i need to cut some fields otherwise i need to append the total line to the new file
function parse()
{
while read LINE
do
echo $LINE |grep -q "Change state"
if
then
echo $LINE |grep -q... (1 Reply)
Hi, guys. I have one question:
I have a file called "group", the contents of it is below:
********************************
...
test:x:203:
sales:x:204:
repair:x:205:
research:x:206:brownj
...
***********
Now I want to add string ",sherrys" at the end of "research:x:206:brownj", so... (5 Replies)
Hi Friends, I have a file with many lines as shown below.
/START SAMPLE LINE/
M:\mmarimut_v6.4.0_pit_01\java\build.xml@@\main\v6.4.0_pit_a
M:\mmarimut_v6.4.0_pit_01\port\Post.java@@\main\v6.4.0_pit_a
M:\mmarimut_v6.4.0_pit_01\switchview\View.java@@\main\v6.4.0_pit_a
/END SAMPLE LINE/
I... (1 Reply)
Hi friends,
I have a file containing many lines as follows.
M:\mmarimut_v6.4.0_pit_01\java\build.xml@@\main\v6.4.0_pit_a
M:\mmarimut_v6.4.0_pit_01\ADBasicView.java@@\main\v6.4.0_pit_a
I would like to append the string "\0" at the end of each line in the file. The output should look... (10 Replies)
Hi Experts,
Is there a way to find a string in a file then append a character to that string then save the file or save to another file.
Here is an example.
>cat test.txt
NULL
NULL
NULL
9,800.00
NULL
1,234,567.01
I want to find all NON NULL String and add a dollar sign to those... (9 Replies)
Hi All,
I'm trying to insert a string into a file at a specific location.
I'd like to add a string after the parent::__construct(); in my file.
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Controller extends CI_Controller {
function... (6 Replies)
How to pre-append a variable string to each line in a file contains both single and double quotes?
The variable string has no quotes in it.
thank you very much.
:confused: (8 Replies)
Hi,
when I do cat for kernel parameters
cat /proc/sys/kernel/sem >> /etc/sysctl.conf
4096 4096 32 128
The above command working with out any doubt
but I want to pass it like below, need to append "kernel.sem =" and pass it to /etc/sysctl.conf kernel.sem = 4096... (2 Replies)
Looking to add text to a file, example
File example;
nodegroups:
check-hosts: L@host.domain.com,host2.domain.com,host3.domain.com
I need to take a file with a one line list of hosts separated by commas
host.domain.com,host2.domain.com,host3.domain.comand prepend the string " ... (6 Replies)
Discussion started by: bash_in_my_head
6 Replies
LEARN ABOUT DEBIAN
ppix::editortools::renamevariable
PPIx::EditorTools::RenameVariable(3pm) User Contributed Perl Documentation PPIx::EditorTools::RenameVariable(3pm)NAME
PPIx::EditorTools::RenameVariable - Lexically replace a variable name in Perl code
SYNOPSIS
my $munged = PPIx::EditorTools::RenameVariable->new->rename(
code => $code,
line => 15,
column => 13,
replacement => 'stuff',
);
my $code_as_strig = $munged->code;
my $code_as_ppi = $munged->ppi;
my $location = $munged->element->location;
DESCRIPTION
This module will lexically replace a variable name.
METHODS
new()
Constructor. Generally shouldn't be called with any arguments.
rename( ppi => PPI::Document $ppi, line => Int, column => Int, replacement => Str ) =item rename( code => Str $code, line => Int, column =>
Int, replacement => Str ) =item rename( code => Str $code, line => Int, column => Int, to_camel_case => Bool, [ucfirst => Bool] ) =item
rename( code => Str $code, line => Int, column => Int, from_camel_case => Bool, [ucfirst => Bool] )
Accepts either a "PPI::Document" to process or a string containing the code (which will be converted into a "PPI::Document") to
process. Renames the variable found at line, column with that supplied in the "replacement" parameter and returns a
"PPIx::EditorTools::ReturnObject" with the new code available via the "ppi" or "code" accessors, as a "PPI::Document" or "string",
respectively. The "PPI::Token" found at line, column is available via the "element" accessor.
Instead of specifying an explicit replacement variable name, you may choose to use the "to_camel_case" or "from_camel_case" options
that automatically convert to/from camelCase. In that mode, the "ucfirst" option will force uppercasing of the first letter.
You can not specify a replacement name and use the "to/from_camel_case" options.
Croaks with a "no token" exception if no token is found at the location. Croaks with a "no declaration" exception if unable to find
the declaration.
SEE ALSO
This class inherits from "PPIx::EditorTools". Also see App::EditorTools, Padre, and PPI.
perl v5.14.2 2012-03-11 PPIx::EditorTools::RenameVariable(3pm)