SEARCH YOUR SOLUTION HERE  

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:  382
View Complete with Replies




Related Messages:

How to quote a semicolon?   (119 Views)
print qw(\; doesn't seem to work.
Escape quote when using-one-line-of-program mode   (125 Views)
My codes: This work: 1. perl -pe 's/(
removing ASCII escape chars from output   (105 Views)
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
FAQ 7.3 Do I always/never have to quote my strings or use semicolons and commas?   (135 Views)
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.
commandline replace and running out of quotes   (125 Views)
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
How to handle single/double quotes when inputing?   (107 Views)
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:
get quote enclosed field in a line   (136 Views)
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".
removing '*' from *****STAFF*****   (112 Views)
Does anyone know how do I remove the beginning and the trailing * from *****STAFF*****
FAQ 7.3 Do I always/never have to quote my strings or use semicolons and commas?   (163 Views)
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.
\Q on an pattern containing double quotes, braces etc.   (105 Views)
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" --------
FAQ 7.3 Do I always/never have to quote my strings or use semicolons and commas?   (138 Views)
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.
removing duplicates   (109 Views)
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
Re: removing users from /etc/group   (207 Views)
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, ...
Perl expression for parsing CSV (ignoring parsing commas when in double quotes)   (148 Views)
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 ...
" fails to quote" class="" href="http://www.solveerrors.com/forums/17/perl/fails-to-quote-239199" style="color:#333333; font-weight:bold;"> "=>" fails to quote   (42 Views)
=> 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) ; ...
FAQ 7.3 Do I always/never have to quote my strings or use semicolons and commas?   (119 Views)
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 ...
Re: removing '*' from *****STAFF*****   (119 Views)
Manasi Bopardikar wrote: > Does anyone know how do I remove the beginning and the trailing * from > *****STAFF***** > > > >
Creating UNICODE filenames with PERL 5.8   (100 Views)
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 ...
Re: newbie question about removing un needed extra lines   (144 Views)
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 ...
How to handling string contains single quote and double quote   (88 Views)
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 ...