05-07-2012
Yes. See Regexp Quote-Like Operators in perlop.
The substitution command replaces first part with second part s/first_part/second_part/. The 'g' flag is to apply the substitution many times for each line.
So, first substitution command replaces [|] with |, and second one {|} with newline ( \n). It is simple, isn't it?
This User Gave Thanks to birei For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to replace a Perl module name in all my Perl Scripts in the cgi-bin directory. How is it possible?
I have the following statement in my scripts
use myUtil;
I want to change it to
use myUtil777;
Regards,
Rahul (2 Replies)
Discussion started by: rahulrathod
2 Replies
2. Shell Programming and Scripting
Hello,
I have a Perl script that reads in an Excel spread sheet and formats the values into a text file. I am having trouble with one column that can have numbers or letters. Excel left justifies the values that start with a letter and right justifies the values that contain only a... (2 Replies)
Discussion started by: jyoung
2 Replies
3. Shell Programming and Scripting
Hi,
I have string like this:
$query="#1,apple";
$string=$query;
I want to replace #1 with fruit. I tried like this:
string=~s/#\d+/$query/ig;
print "\n string: $string\n";
It is working only when there is single #1 or #2 but when i give like #1,#2,#3,apple the above code... (2 Replies)
Discussion started by: vanitham
2 Replies
4. Shell Programming and Scripting
Hi,
I have a file with the following contents and i want to replace that value in a file with some other value.
#file.txt
/local/Disk/data
n
192.168.55.98
52035
3
1
2
1
1
192.168.55.98
Here is my code. (2 Replies)
Discussion started by: vanitham
2 Replies
5. Shell Programming and Scripting
I am trying to write a simple perl script to run on a FreeBSD machine.
There are alot of posts here, and I have read so many, yet can not get this script to run.
#!/usr/bin/perl
-e 's/\r\n/~/' infile.txt outfile.txt
I am trying to take a windows text file, move it into Unix, run a script on... (1 Reply)
Discussion started by: mach1
1 Replies
6. Shell Programming and Scripting
Hello,
I am trying to change a value in a param file, with the Run time variable in .sh scripts
using perl command ,
==========================================
Param file
$$ID=<0>
$$Country=<Country>
==========================================
in the .sh script
val=33
I am... (5 Replies)
Discussion started by: Shanks
5 Replies
7. Shell Programming and Scripting
Hi,
I have a file with two string :
aa_bb_cc_def
gg_hh_jj_xyz
now i want a command in perl script, which gives me the result as :
aa_bb_cc.def
gg_hh_jj.xyz
Can anyone help me on this plz..
thanks in advane. (6 Replies)
Discussion started by: arup1980
6 Replies
8. Shell Programming and Scripting
Hi All,
I am having below issue could anybody help me.
$x= SELECT * FROM EMP --xyz this change is done in q2;
I want delete the charchters from -- to till the end.
I want $x to be
$x= SELECT * FROM EMP;
Thanks,
Vijay G (1 Reply)
Discussion started by: gvk25
1 Replies
9. Shell Programming and Scripting
Hi,
I have an input file and a config file which I need to lookup values in using Perl:
Input file:
ID, Value
COMP0,0
COMP1,1
COMP2,2
COMP3,3
COMP4,3
COMP5,5Config file:
ID, Operation
COMP0,((@COMP1@ + @COMP2@ + @COMP3@) / @COMP4@) + @COMP5@Expected output:
ID, Value
COMP0,7 # This... (0 Replies)
Discussion started by: Subbeh
0 Replies
10. Shell Programming and Scripting
How can I achieve this? Perl would be awesome.
Input string a_b c //Note there is a blank here
Needed Output a_b_c
Thanks (4 Replies)
Discussion started by: dragonpoint
4 Replies
PAPS(1) General Commands Manual PAPS(1)
NAME
paps - UTF-8 to PostScript converter using Pango
SYNOPSIS
paps [options] files...
DESCRIPTION
paps reads a UTF-8 encoded file and generates a PostScript language rendering of the file. The rendering is done by creating outline curves
through the pango ft2 backend.
OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is
included below.
--landscape
Landscape output. Default is portrait.
--columns=cl
Number of columns output. Default is 1.
Please notice this option isn't related to the terminal length as in a "80 culums terminal".
--font=desc
Set the font description. Default is Monospace 12.
--rtl Do right to left (RTL) layout.
--paper ps
Choose paper size. Known paper sizes are legal, letter and A4. Default is A4.
Postscript points
Each postscript point equals to 1/72 of an inch. 36 points are 1/2 of an inch.
--bottom-margin=bm
Set bottom margin. Default is 36 postscript points.
--top-margin=tm
Set top margin. Default is 36 postscript points.
--left-margin=lm
Set left margin. Default is 36 postscript points.
--right-margin=rm
Set right margin. Default is 36 postscript points.
--gutter-width=gw
Set gutter width. Default is 40 postscript points.
--help Show summary of options.
--header
Draw page header for each page.
--markup
Interpret the text as pango markup.
--lpi Set the lines per inch. This determines the line spacing.
--cpi Set the characters per inch. This is an alternative method of specifying the font size.
--stretch-chars
Indicates that characters should be stretched in the y-direction to fill up their vertical space. This is similar to the texttops
behaviour.
AUTHOR
paps was written by Dov Grobgeld <dov.grobgeld@gmail.com>.
This manual page was written by Lior Kaplan <kaplan@debian.org>, for the Debian project (but may be used by others).
April 17, 2006 PAPS(1)