05-16-2018
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Write a nawk script that will produce the following report:
***FIRST QUARTERLY REPORT***
***CAMPAIGN 2004 CONTRIBUTIONS***
-------------------------------------------------------------------------
NAME PHONE Jan | ... (5 Replies)
Discussion started by: p.palakj.shah
5 Replies
2. Shell Programming and Scripting
I want to print between the range two patterns if a particular pattern is present in between the two patterns. I am new to Unix. Any help would be greatly appreciated.
e.g.
Pattern1
Bombay
Calcutta
Delhi
Pattern2
Pattern1
Patna
Madras
Gwalior
Delhi
Pattern2
Pattern1... (2 Replies)
Discussion started by: joyan321
2 Replies
3. Shell Programming and Scripting
Hi guys, trying to replace a '#' with a ' ' (space) but only between the brackets '(' and ')'
N="text1#text2#text3(var1#var2#var3)"
N=`echo $N |sed '/(/,/) s/#. //'`
echo $N
Looking for an output of "text1#text2#text3(var1 var2 var3)"
Any ideas? (15 Replies)
Discussion started by: mikepegg
15 Replies
4. Shell Programming and Scripting
I've a file say having
line 1
line 2
(NP
line 3
line 4
line 5)
line 6
I want to combine lines starting from (NP and ending with ) then it will look like
line 1
line 2
(NP line3 line4 line5)
line 6
I tried using sed '/(NP/,/)$/ s/\n/ /' but it's not working. Any help please?
... (8 Replies)
Discussion started by: neg
8 Replies
5. Shell Programming and Scripting
Still trying to get the basics down and I would like a different solution to what I'm currently doing and a better understanding of why it's happening. I've written a simple backup script that tars individual directories and then dumps them to a NFS drive. STDERR is being dumped into a process... (2 Replies)
Discussion started by: mandelbrot333
2 Replies
6. Shell Programming and Scripting
Hi Experts,
I've issue with the huge file.
My requirement is I need to search a pattern between the 155-156 position and if its match's to 31 or 36 then need to route that to a new separate files.
The main file has around 1459328 line and 2 GB in size. I tired with the below code which take... (9 Replies)
Discussion started by: senthil.ak
9 Replies
7. Shell Programming and Scripting
Hi Everyone!
I really appreciate all of your help, I'm learning so much, can't wait until I get good enough to start answering questions!
I have a problem ... from one large file, I'd like to create multiple new files for each pattern block
beginning with /^ISA/
ending with /^IEA/
... (2 Replies)
Discussion started by: verge
2 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I have a Huge 7 GB file which has around 1 million records, i want to split this file into 4 files to contain around 250k messages each.
Please help me as Split command cannot work here as it might miss tags..
Format of the file is as below
<!--###### ###### START-->... (6 Replies)
Discussion started by: KishM
6 Replies
9. Shell Programming and Scripting
Hi all,
I have been searching all over Google but I am unable to find a solution for a particular result that I am trying to achieve.
Consider the following input:
1
2
3
4
5
B4Srt1--Variable-0000
B4Srt2--Variable-1111
Srt
6
7
8
9
10
End (3 Replies)
Discussion started by: y2jacky
3 Replies
10. Shell Programming and Scripting
I have config file like this:
server_name xx opt1 opt2 opt3
suboptions1
#suboptions - disabled
suboptions2 pattern
suboptions3
server_name yy opt1 opt2 opt3
suboptions1 pattern
#suboptions - disabled
suboptions2
So basically I want to extract the server... (1 Reply)
Discussion started by: nemesis911
1 Replies
LEARN ABOUT DEBIAN
uri::encode
URI::Encode(3pm) User Contributed Perl Documentation URI::Encode(3pm)
NAME
URI::Encode - Simple percent Encoding/Decoding
SYNOPSIS
# OOP Interface
use URI::Encode;
my $uri = URI::Encode->new({encode_reserved =>0});
my $encoded = $uri->encode($data);
my $decoded = $uri->decode($encoded);
# Functional
use URI::Encode qw(uri_encode uri_decode);
my $encoded = uri_encode($data);
my $decoded = uri_decode($encoded);
DESCRIPTION
This modules provides simple URI (Percent) encoding/decoding
The main purpose of this module (at least for me) was to provide an easy method to encode strings (mainly URLs) into a format which can be
pasted into a plain text emails, and that those links are 'click-able' by the person reading that email. This can be accomplished by NOT
encoding the reserved characters.
This module can also be useful when using HTTP::Tiny to ensure the URLs are properly escaped.
If you are looking for speed and want to encode reserved characters, use URI::Escape::XS
See this script <https://github.com/mithun/perl-uri-encode/raw/master/.author/benchmark.pl> for a comparison on encoding results and
performance.
METHODS
new()
Creates a new object, no arguments are required
my $encoder = URI::Encode->new(\%options);
The following options can be passed to the constructor
encode_reserved
my $encoder = URI::Encode->new({encode_reserved => 0});
If true, "Reserved Characters" are also encoded. Defaults to false.
encode($url, $including_reserved)
This method encodes the URL provided. The method does not encode any "Reserved Characters" unless $including_reserved is true or set in the
constructor. The $url provided is first converted into UTF-8 before percent encoding.
$uri->encode("http://perl.com/foo bar"); # http://perl.com/foo%20bar
$uri->encode("http://perl.com/foo bar", 1); # http%3A%2F%2Fperl.com%2Ffoo%20bar
decode($url)
This method decodes a 'percent' encoded URL. If you had encoded the URL using this module (or any other method), chances are that the URL
was converted to UTF-8 before 'percent' encoding. Be sure to check the format and convert back if required.
$uri->decode("http%3A%2F%2Fperl.com%2Ffoo%20bar"); # "http://perl.com/foo bar"
EXPORTED FUNCTIONS
The following functions are exported upon request. This provides a non-OOP interface
uri_encode($url, $including_reserved)
See "encode($url, $including_reserved)"
uri_decode($url)
See "decode($url)"
CHARACTER CLASSES
Reserved Characters
The following characters are considered as reserved (RFC 3986 <http://tools.ietf.org/html/rfc3986>). They will be encoded only if
requested.
! * ' ( ) ; : @ & = + $ , / ? % # [ ]
Unreserved Characters
The following characters are considered as Unreserved. They will not be encoded
a-z
A-Z
0-9
- _ . ~
DEPENDENCIES
Encode
ACKNOWLEDGEMENTS
Gisle Aas for URI::Escape
David Nicol for Tie::UrlEncoder
SEE ALSO
RFC 3986 <http://tools.ietf.org/html/rfc3986>
URI::Escape
URI::Escape::XS
URI::Escape::JavaScript
Tie::UrlEncoder
BUGS AND LIMITATIONS
Please report any bugs or feature requests to "bug-uri-encode@rt.cpan.org", or through the web interface at
http://rt.cpan.org/Public/Dist/Display.html?Name=URI-Encode <http://rt.cpan.org/Public/Dist/Display.html?Name=URI-Encode>
AUTHOR
Mithun Ayachit "mithun@cpan.org"
LICENSE AND COPYRIGHT
Copyright (c) 2012, Mithun Ayachit. All rights reserved.
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-03-24 URI::Encode(3pm)