Removing quote from filenames


all, Please give me a hand here. I've been banging my head for a couple hours trting to get all of the quotes out of the filenames of a group of files. I can't get the "system" call to ...
Posted On: Monday 26th of November 2012 08:47:59 PM Total Views:  411
View Complete with Replies

RELATED TOPICS OF Perl PROGRAMMING LANGUAGE




How to quote a semicolon?

print qw(\; doesn't seem to work.
VIEWS ON THIS POST

131

Posted on:

Wednesday 17th October 2012
View Replies!

Escape quote when using-one-line-of-program mode

My codes: This work: 1. perl -pe 's/(
VIEWS ON THIS POST

137

Posted on:

Wednesday 17th October 2012
View Replies!

removing ASCII escape chars from output

all, I have some output that looks like this ←[21;32H1700←[21;44HTC HUMATHROPE and I am trying to extract the 1700 and HTC HUMATHROPE. Can someone point me in the right direction
VIEWS ON THIS POST

118

Posted on:

Saturday 20th October 2012
View Replies!

FAQ 7.3 Do I always/never have to quote my strings or use semicolons and commas?

This is an excerpt from the latest version perlfaq7.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 7.3: Do I always/never have to quote my strings or use semicolons and commas Normally, a bareword doesn't need to be quoted, but in most cases probably should be (and must be under "use strict"). But a hash key consisting of a simple word (that isn't the name of a defined subroutine) and the left-hand operand to the "=>" operator both count as though they were quoted: This is like this ------------ --------------- $foo{line} $foo{'line'} bar => stuff 'bar' => stuff The final semicolon in a block is optional, as is the final comma in a list. Good style (see perlstyle) says to put them in except for one-liners: if ($whoops) { exit 1 } @nums = (1, 2, 3); if ($whoops) { exit 1; } @lines = ( "There Beren came from mountains cold", "And lost he wandered under leaves", ); -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

148

Posted on:

Saturday 20th October 2012
View Replies!

commandline replace and running out of quotes

I am using the inplace edit of commandline perl in a per script. How do I insert those doublequotes in the RHS system qq|perl -pi -e "s/(=#FILE_MARKER)/" $var "/| file_name; ^ ^ Thanls Eric Smith
VIEWS ON THIS POST

138

Posted on:

Monday 22nd October 2012
View Replies!

How to handle single/double quotes when inputing?

I wrote a validation routine to handle invalid input but if the user types in a single or double quote in the first column of any text input in a html page, then the code appears in the input box:
VIEWS ON THIS POST

123

Posted on:

Saturday 3rd November 2012
View Replies!

get quote enclosed field in a line

is there a simple way in perl, python, or awk/shell/pipe, that gets the user agent field in a apache log e.g. the typical line is like this: 189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET / Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xahlee.org "http://xahlee.org/Periodic_dosage_dir/lacru/manara2.html" "Mozilla/ 5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13" "-" I want the part: "Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv: 1.8.1.13) Gecko/20080311 Firefox/2.0.0.13".
VIEWS ON THIS POST

151

Posted on:

Sunday 4th November 2012
View Replies!

removing '*' from *****STAFF*****

Does anyone know how do I remove the beginning and the trailing * from *****STAFF*****
VIEWS ON THIS POST

124

Posted on:

Monday 5th November 2012
View Replies!

FAQ 7.3 Do I always/never have to quote my strings or use semicolons and commas?

This is an excerpt from the latest version perlfaq7.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 7.3: Do I always/never have to quote my strings or use semicolons and commas Normally, a bareword doesn't need to be quoted, but in most cases probably should be (and must be under "use strict"). But a hash key consisting of a simple word (that isn't the name of a defined subroutine) and the left-hand operand to the "=>" operator both count as though they were quoted: This is like this ------------ --------------- $foo{line} $foo{'line'} bar => stuff 'bar' => stuff The final semicolon in a block is optional, as is the final comma in a list. Good style (see perlstyle) says to put them in except for one-liners: if ($whoops) { exit 1 } @nums = (1, 2, 3); if ($whoops) { exit 1; } @lines = ( "There Beren came from mountains cold", "And lost he wandered under leaves", ); -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

179

Posted on:

Monday 5th November 2012
View Replies!

\Q on an pattern containing double quotes, braces etc.

Dear Folks, I want to comment out certain lines in a file that match a particular pattern. The file contains lines with characters like: {, }, ==, and ". Specifically, I want to replace lines beginning with ATTRS{idVendor}=="07b4", ATTRS{idProduct}=="0109", with # ATTRS{idVendor}=="07b4", ATTRS{idProduct}=="0109", I have been unsuccessful in including the pattern as above and have had to work around using just the two number patterns like so: -------- #!/usr/bin/perl -i.bak -pl use warnings; use strict; m/07b4/ and m/0109/ and s/$_/# $_/; -------- This works, but leaves me wondering how I could include the full pattern, including metacharacters. Using \Q did not help, but perhaps I was doing something wrong. I have included some sample lines that can be used as an input file. -------- ATTRS{idVendor}=="0553", ATTRS{idProduct}=="0202", MODE="0660", GROUP="plugdev" ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="0403", MODE="0660", GROUP="plugdev" ATTRS{idVendor}=="07b4", ATTRS{idProduct}=="0109", MODE="0660", GROUP="plugdev" ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="0404", MODE="0660", GROUP="plugdev" ATTRS{idVendor}=="04fc", ATTRS{idProduct}=="504b", MODE="0660", GROUP="plugdev" ATTRS{idVendor}=="07b4", ATTRS{idProduct}=="0100", MODE="0660", GROUP="plugdev" ATTRS{idVendor}=="07b4", ATTRS{idProduct}=="0105", MODE="0660", GROUP="plugdev" ATTRS{idVendor}=="07b4", ATTRS{idProduct}=="0114", MODE="0660", GROUP="plugdev" ATTRS{idVendor}=="07b4", ATTRS{idProduct}=="0114", MODE="0660", GROUP="plugdev" ATTRS{idVendor}=="07b4", ATTRS{idProduct}=="0109", MODE="0660", GROUP="plugdev" ATTRS{idVendor}=="07b4", ATTRS{idProduct}=="0105", MODE="0660", GROUP="plugdev" --------
VIEWS ON THIS POST

116

Posted on:

Monday 5th November 2012
View Replies!

FAQ 7.3 Do I always/never have to quote my strings or use semicolons and commas?

This is an excerpt from the latest version perlfaq7.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 7.3: Do I always/never have to quote my strings or use semicolons and commas Normally, a bareword doesn't need to be quoted, but in most cases probably should be (and must be under "use strict"). But a hash key consisting of a simple word (that isn't the name of a defined subroutine) and the left-hand operand to the "=>" operator both count as though they were quoted: This is like this ------------ --------------- $foo{line} $foo{'line'} bar => stuff 'bar' => stuff The final semicolon in a block is optional, as is the final comma in a list. Good style (see perlstyle) says to put them in except for one-liners: if ($whoops) { exit 1 } @nums = (1, 2, 3); if ($whoops) { exit 1; } @lines = ( "There Beren came from mountains cold", "And lost he wandered under leaves", ); -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod.
VIEWS ON THIS POST

154

Posted on:

Wednesday 7th November 2012
View Replies!

removing duplicates

I'm trying to write a script to remove duplicate e-mail addresses from a list. I'd like some help understanding... 1. Why does it remove all but one of the duplicate lines 2. How can I fix it
VIEWS ON THIS POST

122

Posted on:

Wednesday 7th November 2012
View Replies!

Re: removing users from /etc/group

heylow wrote: > I have a master file /etc/group, and another file contains logins > (say, master.login). I want to delete all users in /etc/group, who do > not exist in this master.login > I wanted to remove users (a, ...
VIEWS ON THIS POST

228

Posted on:

Thursday 15th November 2012
View Replies!

Perl expression for parsing CSV (ignoring parsing commas when in double quotes)

I can't figure an expression needed to parse a string. This problem arrises from parsing Excel csv files ... The expression must parse a string based upon comma delimiters, but if a comma appears in double quotes it should not ...
VIEWS ON THIS POST

160

Posted on:

Monday 19th November 2012
View Replies!

" fails to quote" style="color:#1385b4;text-transform:uppercase;" name="Post_239199"> "=>" fails to quote

=> fails to quote some bare identifiers to the left of it - is this a known "feature" test program: #! /usr/bin/perl -w %server = ('66.185.33.35'=>ascend06) ; for $key (keys %server) { print "<$key>\t<$server{$key}>\n" ; } %server = (66.185.33.35=>ascend06) ; ...
VIEWS ON THIS POST

47

Posted on:

Monday 19th November 2012
View Replies!

FAQ 7.3 Do I always/never have to quote my strings or use semicolons and commas?

This is an excerpt from the latest version perlfaq7.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest ...
VIEWS ON THIS POST

138

Posted on:

Monday 19th November 2012
View Replies!

Re: removing '*' from *****STAFF*****

Manasi Bopardikar wrote: > Does anyone know how do I remove the beginning and the trailing * from > *****STAFF***** > > > >
VIEWS ON THIS POST

130

Posted on:

Sunday 25th November 2012
View Replies!

Creating UNICODE filenames with PERL 5.8

I have been having distinct trouble creating file names in PERL containing UNICODE characters. I am running ActiveState PERL 5.8 on Windows 2000. For a simple test, I picked a UNICODE character that could be displayed by Windows Explorer. I ...
VIEWS ON THIS POST

113

Posted on:

Monday 26th November 2012
View Replies!

Re: newbie question about removing un needed extra lines

Scott Taylor wrote: > > I've just started learning perl, and had two questions. One, what is > the best way to open a text file and remove all of the empty lines > Example: > > a@a.com > b@b.com ...
VIEWS ON THIS POST

176

Posted on:

Monday 26th November 2012
View Replies!

How to handling string contains single quote and double quote

I facing a problem in saving a string contains single and double quote into a file .The string look like the following:- Example:- Developer's community "com.lang.perl" -------------------------------------------------------- The part of Code is:- #!/bin/perl -w use strict; my $Date="10-09-2007"; system("echo ...
VIEWS ON THIS POST

98

Posted on:

Monday 26th November 2012
View Replies!