Hi,
I have a program that searches for a particular string patten. I am however having difficulty passing the varible $i (in a loop) as the string pattern to replace. Using either perl or sed search and replace statements, I get the same kinda result. For example, using the perl:
for i in... (3 Replies)
I have lines in a file that look like this:
machine: machinea
machine: machineb
machine: randomwhatevermachine
I want to replace the machine lines with:
machine: machinec
I tried
perl -pi -e "s/#machine:\?*/machine: machinec/" filename
But this ended up doing this:
... (2 Replies)
Hi ,
I am stuck up in the below scenario:-
I need to read a file name (eg A.txt) name frm another file (eg B.txt) and then I need to search for a particular expression in A.txt and substitute it with another expression.
How can I use SED inside SHELL Scripting and command prompt as... (2 Replies)
Hi guys,
Can u please help me to replace (-) with (/) in a file containing no of records using "sed " command in unix.
thanks in advance.
subhendu (5 Replies)
I have file.txt
1 4 7 9 3
I want to replace the tabs with a space, but my code doesn't work.
cat file.txt | sed 's/"\t"/ /g' > t.txt
But file is still the same. Numbers seperated by tabs instead of spaces.
Help? (2 Replies)
Using sed I'm trying to replace 'string' with ']' while retaining case and ignoring words with 'string' in it along with additional characters like 'strings' and those which already contain the ] wrapper. I'm hoping to do it with sed and the right expression, if possible.
Example:
Apple... (2 Replies)
Hi All,
I need the perl version of the below sed command:
sed 's/abc.*/&.txt/g' <filename>
Because I'm trying to do some replacement recursively using perl and the above replacement is replacing the abc* with "&.txt" exactly.
Thanks,
Arun (9 Replies)
Hello all
I have a strings like
" Watch news 24x7 "."x-wars is glowing"
" Watch news like 24 x 7"."x-mas will be celebrated"
" Dimensions of box is 24x23x47 ".
I have to remove the x(by) in between the number. If i just replace x, it will also remove all x's from text which i do not want.... (1 Reply)
Hi,
I'm new to Perl, and I want to change a few columns in a file in order to insert them into a database.
The input file looks like this:
00001,"01/1234567" ,"Tst2"
00002,"01/4545646" ,"Tst123456"
00003,"01/8979898" ,""
The output should look like this:
01-1234567,00001... (2 Replies)
OSX
I have been grinding my teeth on a portion of code. I am building a bash script that edits a html email template. In the template, I have place holders for SED (or whatever program is appropriate) to use as anchors for find and replace, with user defined corresponding html code. The HTML code... (3 Replies)
Discussion started by: sudo
3 Replies
LEARN ABOUT DEBIAN
imager::qrcode
Imager::QRCode(3pm) User Contributed Perl Documentation Imager::QRCode(3pm)NAME
Imager::QRCode - Generate QR Code with Imager using libqrencode
SYNOPSIS
use Imager::QRCode;
my $qrcode = Imager::QRCode->new(
size => 2,
margin => 2,
version => 1,
level => 'M',
casesensitive => 1,
lightcolor => Imager::Color->new(255, 255, 255),
darkcolor => Imager::Color->new(0, 0, 0),
);
my $img = $qrcode->plot("blah blah");
$img->write(file => "qrcode.gif");
# or instance method
use Imager::QRCode qw(plot_qrcode);
my $img = plot_qrcode("blah blah", \%params);
$img->write(file => "qrcode.gif");
DESCRIPTION
This module allows you to generate QR Code with Imager. This module use libqrencode '2.0.0' and above.
METHODS
new
$qrcode = Imager::QRCode->new(%params);
The "new()" constructor method instantiates a new Imager::QRCode object. "new()" accepts the following parameters.
o "size" - Horizontal and vertical size of module(dot). Default is 4.
o "margin" - Margin size of QR Code. Default is 3.
o "level" - Error collectin level. Valid values are 'M', 'L', 'Q' or 'H'. Default is 'L'.
o "version" - Version of the symbol. If specify '0', this module chooses the minimum version for the input data. Default is '0'.
o "mode" - Encoding mode. Valid values are 'numerical', 'alpha-numerical', '8-bit' or 'kanji'. Default is '8-bit'.
If not give "casesensitive" then should be given "mode". If 'kanji' is given, characters will be encoded as Shift-JIS characters.
If '8-bit' is given, all of non-alpha-numerical characters will be encoded as is. If you want to embed UTF-8 string, choose
'8-bit'.
o "casesensitive" - If your application is case-sensitive using 8-bit characters, set to '1'. Default is '0'.
plot($text)
$img = $qrcode->plot("blah blah");
Create a new QR Code image. This method returns Imager object ploted QR Code with the given text.
INSTANT METHODS
plot_qrcode($text, \%params)
Instant method. $text is input text. %params is same parameter as "new()".
SEE ALSO
"Imager", "http://www.qrcode.com/", "http://megaui.net/fukuchi/works/qrencode/index.en.html"
AUTHOR
Yoshiki KURIHARA "<kurihara __at__ cpan.org>"
THANKS
Tokuhiro Matsuno
LICENCE AND COPYRIGHT
Copyright (c) 2011, Yoshiki KURIHARA "<kurihara __at__ cpan.org>".
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
perl v5.14.2 2012-12-16 Imager::QRCode(3pm)