Hi All,
I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text.
An example of 4 lines in my file is:
1. MatchText_randomNumberOfText moreData ReplaceMe moreData
2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
I am very new to Perl. I am struggling so hard to search a date (such as 10/09/2009, 10-09-2009) from a text file and replace with a string (say DATE) using Perl. Please help me out. Thanks in advance.
Regds
Doren (4 Replies)
Hi All,sorry for inconvience....please find the attachement for my question i am unable to paste the question here....please help me in slving thisthanksk.k (4 Replies)
Hello All,
Here is what I am trying to do and maybe you guys can point me in the right direction. I have a file that contains the following string(s):
WARNING: </d1/test/program1> did not find item1
WARNING: </d1/test/program1> item1 does not exist
WARNING: </d1/test/program2> item1 failed... (1 Reply)
HI
I'm terribly new to perl .. I;ve been trying to use this command to search and replace entries in a file
I tried this and it works
perl -p -i -e 's/old/new/' filename
Problem is that I have a list of email addresses and I need to serach and replace the entire email address as my... (5 Replies)
Dear all,
I have a number of files and each file has two sections separated by a blank line. At the top section, I have lines which describes the values of the alphabetical characters,
# s #; 0.123
# p #; 12.3
# d #; -2.33
# f #; 5.68
<blank line>
sssssss
spfdffff
sdfffffff
Now I... (4 Replies)
Hi,
I am having trouble while using 'sed' with reading files. Please help. I have 3 files. File A, file B and file C. I want to find content of file B in file A and replace it by content in file C.
Thanks a lot!!
Here is a sample of my question.
e.g. (file A: a.txt; file B: b.txt; file... (3 Replies)
Hi,I have 2 files master.txt & reference.txt as shown below & i require o/p as mentioned in file 3 using awk but content is not replacing properlymaster.txt:... (15 Replies)
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
LEARN ABOUT DEBIAN
www::mechanize::gzip
WWW::Mechanize::GZip(3pm) User Contributed Perl Documentation WWW::Mechanize::GZip(3pm)NAME
WWW::Mechanize::GZip - tries to fetch webpages with gzip-compression
VERSION
Version 0.10
SYNOPSIS
use WWW::Mechanize::GZip;
my $mech = WWW::Mechanize::GZip->new();
my $response = $mech->get( $url );
print "x-content-length (before unzip) = ", $response->header('x-content-length');
print "content-length (after unzip) = ", $response->header('content-length');
DESCRIPTION
The WWW::Mechanize::GZip module tries to fetch a URL by requesting gzip-compression from the webserver.
If the response contains a header with 'Content-Encoding: gzip', it decompresses the response in order to get the original (uncompressed)
content.
This module will help to reduce bandwith fetching webpages, if supported by the webeserver. If the webserver does not support gzip-
compression, no decompression will be made.
This modules is a direct subclass of WWW::Mechanize and will therefore support any methods provided by WWW::Mechanize.
The decompression is handled by Compress::Zlib::memGunzip.
There is a small webform, you can instantly test, whether a webserver supports gzip-compression on a particular URL:
<http://www.computerhandlung.de/www-mechanize-gzip.htm>
METHODS
prepare_request
Adds 'Accept-Encoding' => 'gzip' to outgoing HTTP-headers before sending.
send_request
Unzips response-body if 'content-encoding' is 'gzip' and corrects 'content-length' to unzipped content-length.
SEE ALSO
WWW::Mechanize
Compress::Zlib
AUTHOR
Peter Giessner "cardb@planet-elektronik.de"
LICENCE AND COPYRIGHT
Copyright (c) 2007, Peter Giessner "cardb@planet-elektronik.de". All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.0 2009-06-24 WWW::Mechanize::GZip(3pm)