Sponsored Content
Top Forums Shell Programming and Scripting Perl Cutting character(s) from a word Post 302485463 by ahmed_zaher on Wednesday 5th of January 2011 09:26:07 AM
Old 01-05-2011
Perl Cutting character(s) from a word

Hello,

How to cut a char(s) for a word using perl??

I want to cut the number(s) from these sample words:

Port-channel24
Po78
Po99
Port-channel34

Code:
$word = "Port-channel24";

I want to put only the number in a varible.
Appreaciate using simple way in order to use it furthur.

Thanks,
Ahmed
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Help in Cutting a word

Hi All , i am working on a backup script , which would a call a executable file in unix server , Login credentials :: use telnet session to login to Unix server when logged in, this would be my Prompt ::: unix11@raghav: I just need to cut the word unix11 , so that i can use this... (12 Replies)
Discussion started by: raghav1982
12 Replies

2. UNIX for Dummies Questions & Answers

Cutting a string based on the third occcurence of a character

Hello, I am new to unix hence struggling with my requirement. I have a string like : ECR/CHQ/GBP/12345.out I need to get only the ECR/CHQ/GBP portion of the string(cut the string based on the third occurrence of / )...How do it do it? Many thanks (3 Replies)
Discussion started by: valluvan
3 Replies

3. Shell Programming and Scripting

How to cut first line only from a text near a specific column without cutting a word

First I have to say thank you to this community and this forum. You helped me very much builing several useful scripts. Now, I can't get a solution the following problem, I'm stuck somehow. Maybe someone has an idea. In short, I dump a site via lynx and pipe the output in a file. I need to... (7 Replies)
Discussion started by: lowmaster
7 Replies

4. Shell Programming and Scripting

Command to parse a word character by character

Hi All, Can anyone help me please, I have a word like below. 6,76 I want to read this word and check if it has "," (comma) and if yes then i want to replace it with "." (dot). That means i want to be changed to 6.76 If the word doesnot contain "," then its should not be changed. Eg. ... (6 Replies)
Discussion started by: girish.raos
6 Replies

5. Shell Programming and Scripting

perl (word by word check if a hash key)

Hi, Now i work in a code that 1-get data stored in the database in the form of hash table with a key field which is the " Name" 2-in the same time i open a txt file and loop through it word by word 3- which i have a problem in is that : I need to loop word by word and check if it is a... (0 Replies)
Discussion started by: eng_shimaa
0 Replies

6. Shell Programming and Scripting

Removing the 1st character of the word in perl

Hi All, In one of the sections in my perl script, I need to remove the 1st character of a word and store in an array.The details are , The original script was , if ( ! defined $inq{$node}{"dmx"} ) { print "INFO: Collecting inq disk information for DMX array on $node.\n"; ... (2 Replies)
Discussion started by: abhilash.pa
2 Replies

7. Shell Programming and Scripting

extract whole thing in word, leaving behind last word. - perl

Hi, i've a string /u/user/DTE/T_LOGS/20110622_011532_TEST_11_HD_120/HD/TESi T_11_HD_120/hd-12 i need to get string, like /u/user/DTE/T_LOGS/20110622_011532_TEST_11_HD_120/HD the words from HD should get deleted, i need only a string till HD, i dont want to use any built in... (4 Replies)
Discussion started by: asak
4 Replies

8. Shell Programming and Scripting

AWK Substring without cutting off word

Can someone help me to make this code without cutting off words ni the string? awk '{for(i=1;i<length;i+=100) print substr($0,i,100)}' Thank you! (4 Replies)
Discussion started by: sanantonio7777
4 Replies

9. Shell Programming and Scripting

perl lwp find word and print next word :)

hi all, I'm new there, I'm just playing with perl and lwp and I just successfully created a script for log in to a web site with post. I have a response but I would like to have something like this: I have in my response lines like: <div class="sender">mimi020</div> <some html code.....>... (3 Replies)
Discussion started by: vogueestylee
3 Replies

10. Shell Programming and Scripting

Cutting a string using more than one character as delimiter

Hi , I have a set of files in a folder which i need to cut in to two parts.... Sample files touch AE_JUNFOR_2014_MTD_2013-05-30-03-30-02.TXT touch AE_JUNFOR_2014_YTD_2013-05-30-03-30-02.TXT touch temp_AE_JUNFOR_2014_MTD_2013-05-30-03-30-02.TXT touch... (4 Replies)
Discussion started by: chillblue
4 Replies
Netlist::Port(3pm)					User Contributed Perl Documentation					Netlist::Port(3pm)

NAME
Verilog::Netlist::Port - Port for a Verilog Module SYNOPSIS
use Verilog::Netlist; ... my $port = $module->find_port ('pinname'); print $port->name; DESCRIPTION
A Verilog::Netlist::Port object is created by Verilog::Netlist::Module for every port connection in the module. ACCESSORS
See also Verilog::Netlist::Subclass for additional accessors and methods. $self->array Any array declaration for the port. This only applies to Verilog 1995 style ports which can declare port bits independently from the signal declarations. When using Verilog 2001 style ports, see the matching net declaration's lsb and msb methods instead, for example "$module-"find_net($port->name)->msb>. $self->comment Returns any comments following the definition. keep_comments=>1 must be passed to Verilog::Netlist::new for comments to be retained. $self->data_type The SystemVerilog data type of the port. $self->direction The direction of the port: "in", "out", or "inout". $self->module Reference to the Verilog::Netlist::Module the port is in. $self->name The name of the port. $self->net Reference to the Verilog::Netlist::Net the port connects to. Only valid after the netlist is linked. $self->type Approximately an alias of data_type for backward compatibility. Do not use for new applications. MEMBER FUNCTIONS
See also Verilog::Netlist::Subclass for additional accessors and methods. $self->dump Prints debugging information for this port. DISTRIBUTION
Verilog-Perl is part of the <http://www.veripool.org/> free Verilog EDA software tool suite. The latest version is available from CPAN and from http://www.veripool.org/verilog-perl <http://www.veripool.org/verilog-perl>. Copyright 2000-2012 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. AUTHORS
Wilson Snyder <wsnyder@wsnyder.org> SEE ALSO
Verilog-Perl, Verilog::Netlist::Subclass Verilog::Netlist perl v5.14.2 2012-05-04 Netlist::Port(3pm)
All times are GMT -4. The time now is 03:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy