Sponsored Content
Top Forums Shell Programming and Scripting Remove parenthesis character (Perl) Post 302252010 by Ikon on Tuesday 28th of October 2008 02:53:45 PM
Old 10-28-2008
Code:
# cat par.pl

$data="abc(123";
$data =~ s/\(/ /;
print $data;

# perl par.pl
abc 123
#

This worked for me.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to only remove parenthesis and : leave the rest

Hi all, I'm stuck on this last part...am running a simple script under AIX to extract NetView host IP addresses. The line below returns the IP address in parenthesis with a trailing colon, i.e. ping -c 1 $name |grep \( | awk '{ print $3 }' --------> returns (a.b.c.d): How can I only... (10 Replies)
Discussion started by: livinthedream
10 Replies

2. Shell Programming and Scripting

Perl RegExp to remove last character from strings

I use SAS (a statistical software) and have to remove last character or the last 1/2 numbers that appear after characters from the string using Perl Regular Expression (which is recognized by SAS). Input: f183ii10 f183ii2 f182ii1 f182ii2 f183iim f22ii f22ii11 f22ii12 pmh4 pmhm Desired... (2 Replies)
Discussion started by: ospreyeagle
2 Replies

3. Shell Programming and Scripting

Perl use split and remove specific character

i want to split the input by a space and remove specific characters like full stop, comma...... etc. and then save each word in an array. i got something below, but it didn't work. can anyone please help me? Thank you #!/usr/bin/perl -w while (<>) { $line = <>; @word = split(' ',... (6 Replies)
Discussion started by: mingming88
6 Replies

4. Shell Programming and Scripting

Remove a ^M character

Hi, I'd like to ask for some help with the following: I've cut a couple of columns of file1 to create file2 with the following code: cur -f 1,3,8 file1 > file2 Then I need to transfer file 2 from UNIX to Windows and use it further. Unfortunatelly, for some reason the line is displayed... (4 Replies)
Discussion started by: zajtat
4 Replies

5. UNIX for Dummies Questions & Answers

How to remove \ character

Dear Members, I have a file which is a single line file. It has "\" character and i need to replace this character with a new line character. How can we do this? I tried with sed but it did not work. sed 's//"\n"/g' t1 > t2Thanks Sandeep (3 Replies)
Discussion started by: sandeep_1105
3 Replies

6. HP-UX

How to remove new line character and append new line character in a file?

Hi Experts, I have data coming in 4 columns and there are new line characters \n in between the data. I need to remove the new line characters in the middle of the row and keep the \n character at the end of the line. File is comma (,) seperated. Eg: ID,Client ,SNo,Rank 37,Airtel \n... (8 Replies)
Discussion started by: sasikari
8 Replies

7. Shell Programming and Scripting

perl cmd to remove the control-Z character at end of 10GB file

In a 10-50GB file , at end of file there is Control-z character tried the below options, 1. perl -p -i -e 's/^Z//g' new.txt 2. perl -0777lwi -032e0 new.txt and Sed command, dos2unix etc it takes more time to remove the control-z. need a command or perl program to GO TO LAST LINE OF FILE ... (7 Replies)
Discussion started by: prsam
7 Replies

8. UNIX for Dummies Questions & Answers

Renaming files to remove everything before one parenthesis

Hi, I have files in a folder that I would like all renamed without the preceding number and parenthesis. For example, I have files of the name 08) Great Good Fine Ok - Not Going Home 09) Roosevelt - Small Hours 10) RAC - I Should've Guessed Feat. SPEAK and I would like them all to be... (4 Replies)
Discussion started by: jyu429
4 Replies

9. Shell Programming and Scripting

Remove parenthesis and run awk calculation

The awk below works fine if I manually remove the () from file1. However, when I try to use tr to remove the () and then | into awk to run the calculation no result is obtained. Is there a way to tell the awk to ignore the () in fiile1 if they are there or do I need to remove them first? Thank... (5 Replies)
Discussion started by: cmccabe
5 Replies

10. Shell Programming and Scripting

How to remove newline character if it is the only character in the entire file.?

I have a file which comes every day and the file data look's as below. Vi abc.txt a|b|c|d\n a|g|h|j\n Some times we receive the file with only a new line character in the file like vi abc.txt \n (8 Replies)
Discussion started by: rak Kundra
8 Replies
PAR::Filter::Bytecode(3)				User Contributed Perl Documentation				  PAR::Filter::Bytecode(3)

NAME
PAR::Filter::Bytecode - Bytecode filter SYNOPSIS
PAR::Filter::Bytecode->apply($code); # transforms $code DESCRIPTION
This filter is deprecated. The B::Bytecode code has been removed from the newest development series of perl and will not be included in perl 5.10 any more. Please have a look at Steve Hay's PAR::Filter::Crypto module if you want to hide your sources. This filter uses B::Bytecode to turn the script into comment-free, architecture-specific Perl bytecode, and uses ByteLoader to load back on execution. For pp users, please add an extra -M option, like this: pp -f Bytecode -M ByteLoader Otherwise, the implicit dependency on ByteLoader will not be detected. CAVEATS
This backend exhibits all bugs listed in B::Bytecode, and then some. Bytecode support is considered to be extremely fragile on Perl versions earlier than 5.8.1, and is still far from robust (as of this writing). Bytecode is not supported by perl 5.9 and later. SEE ALSO
PAR::Filter, B::Bytecode, ByteLoader Filter::Crypto, PAR::Filter::Crypto AUTHORS
Audrey Tang <cpan@audreyt.org> <http://par.perl.org/> is the official PAR website. You can write to the mailing list at <par@perl.org>, or send an empty mail to <par-subscribe@perl.org> to participate in the discussion. Please submit bug reports to <bug-par@rt.cpan.org>. COPYRIGHT
Copyright 2003-2009 by Audrey Tang <cpan@audreyt.org>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <http://www.perl.com/perl/misc/Artistic.html> perl v5.18.2 2012-01-06 PAR::Filter::Bytecode(3)
All times are GMT -4. The time now is 03:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy