hi ,
I have a String str="/opt/ibm/lotus/ibw/latest" or ="/opt/lotus/ibw/latest" this value is dynamic..I want to split this string into 2 strings
1. /opt/ibm/lotus(/opt/lotus) this string must ends with "lotus"
2./ibw/latest
can any body help me on this?
Regards,
sankar (2 Replies)
Hi
I'm trying to find a way to search a text file for a specific string.
I have a file which contains i.p. addresses and port numbers in the following format:
'ip="www.xxx.yyy.zzz"'
'port="xx""'
I want to print only the parts between the double quotes for use in seperate variables,... (4 Replies)
Hi folks,
I have a text file that I need to parse, and I cant figure it out. The source is a report breaking down softwares from various companies with some basic info about them (see source snippet below). Ultimately what I want is an excel sheet with only Adobe and Microsoft software name and... (5 Replies)
Hi,
I need to remove some lines from an XML file is the value within a tag is empty.
Imagine this scenario,
<acd><acdID>2</acdID><logon></logon></acd>
<acd><acdID></acdID><logon></logon></acd>
<acd><acdID></acdID><logon></logon></acd>
<acd><acdID></acdID><logon></logon></acd>
I... (3 Replies)
This is a variation of an earlier post found here:
unixcom/shell-programming-scripting/159821-merge-two-non-consecutive-lines.html
User Bartus11 was kind enough to solve that example.
Previously, I needed help combining two lines that are non-consecutive in a file. Now I need to do the... (7 Replies)
Hi Folks
I'm looking for help with if statement.
I'm reading the file with header (starts with 0 on position 1 in the line) and data (starts with 1 on position 1 in the line).
I have to check if the number from header (should be number of data rows) equal actual count of the data rows.
... (4 Replies)
Hi All,
I have following listing
Filesystem GB blocks Free Used Iused Iused Mounted on
/dev/hd2 4.00 0.31 93 63080 43 /usr
Filesystem GB blocks Free Used Iused Iused Mounted on
Filesystem GB blocks Free Used Iused Iused... (11 Replies)
I want to keep last 2 days data from a file and want to delete others data from the file. Please help me.
Sample Input
# cat messages-2
Apr 15 11:25:03 test1 kernel: imklog 4.6.2, log source = /proc/kmsg started.
Apr 15 11:25:03 test1 rsyslogd: (re)start
Apr 16 19:42:03 test1 kernel:... (2 Replies)
Hi,
I have a file like below.
1,2,3,4,5,6,7,8,9I would like to print or copied to a file based of line count in perl
If I gave a condition 1 to 3 then it should iterate over above file and print 1 to 3 and then again 1 to 3 etc.
output should be
1,2,3
4,5,6
7,8,9 (10 Replies)
The awk below uses the tab-delimeted fileand reformats each line based on one of three conditions (rules). The 3 rules are for deletion (lines in blue), snv (line in red), and insertion (lines in green). I have included all possible combinations of lines from my actual data, which is very large.... (0 Replies)
Discussion started by: cmccabe
0 Replies
LEARN ABOUT DEBIAN
ppix::editortools::renamepackage
PPIx::EditorTools::RenamePackage(3pm) User Contributed Perl Documentation PPIx::EditorTools::RenamePackage(3pm)NAME
PPIx::EditorTools::RenamePackage - Change the package name
SYNOPSIS
my $munged = PPIx::EditorTools::RenamePackage->new->rename(
code => "package TestPackage;
use strict;
BEGIN {
$^W = 1;
}
1;
",
replacement => 'NewPackage'
);
my $new_code_as_string = $munged->code;
my $package_ppi_element = $munged->element;
DESCRIPTION
This module uses PPI to change the package name of code.
METHODS
new()
Constructor. Generally shouldn't be called with any arguments.
rename( ppi => PPI::Document $ppi, replacement => Str ) =item rename( code => Str $code, replacement => Str )
Accepts either a "PPI::Document" to process or a string containing the code (which will be converted into a "PPI::Document") to
process. Replaces the package name 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.
Croaks with a "package name not found" exception if unable to find the package name.
SEE ALSO
This class inherits from "PPIx::EditorTools". Also see App::EditorTools, Padre, and PPI.
perl v5.14.2 2012-03-11 PPIx::EditorTools::RenamePackage(3pm)