Hi
I am running a script (which compares two directory contents) for which I am getting an output of 70 pages in which few pages are blank so I was able to delete those blank lines.
But I also want to delete the headers present for each page. can any one help me by providing the code... (1 Reply)
Hi,
I'm trying to strip all lines between two headers in a file:
### BEGIN ###
Text to remove, contains all kinds of characters
...
Antispyware-Downloadserver.com (Germany)=http://www.antispyware-downloadserver.c
om/updates/
Antispyware-Downloadserver.com #2... (3 Replies)
Hello,
I have done much googling on this, but apparently not using the right keywords.
I am assuming there is some kind of header for each file on a disk which stores information such as mod time, access time, etc.
I have two questions:
1) is there a way to read this header directly,... (2 Replies)
Hi ,
I have a .txt file in which I have multiple headers, the header record starts with $ symbol...like the first column name is $Account.
I have to keep the header in the first line and delete all the remaining headers which are in the file.
I tried using sort adc.txt | uniq -u , but my... (7 Replies)
Hey Guys,
Absolute neewbie here. I am trying to see if it is possible to edit headers/meta-data of files in Mac OSX. I am basically trying to change an audio file header to read 16bit instead of 24bit.
We have an issue with some of our software and it regularly exports 16bit audio files with... (3 Replies)
Good evening
Im new at unix shell scripting and im planning to script a shell that removes headers for about 120 files in a directory and each file contains about 200000
lines in average.
i know i will loop files to process each one and ive found in this great forum different solutions... (5 Replies)
Hi I need to merge 4 files. The issue i am facing is all the files have headers and i do not want them in the final output file. Can anybody suggest how to do it? (5 Replies)
Hi Experts,
I want to join two files(file1 ,file2) which are having tab separated values,by sorting them on key column(ID) and want to redirect the output to other file(output file) along with the headers from both the files.
cat file1:
ID Name phone_no
205 mno 90808
200 xyz 32003... (9 Replies)
All,
I guess by this time someone asked this kind of question, but sorry I am unable to find after a deep search.
Here is my request
I have many files out of which 2 sample files provided below.
File-1 (with A,B as column headers)
A,B
1,2
File-2 (with C, D as column headers)
C,D
4,5
I... (7 Replies)
The below awk verifies the count and order of each text file in the directory. The script does execute and produce output, however the order of the headers are not compared to key. The portion in bold is supposed to do that. If the order of the headers in each text file is the same as key, then... (0 Replies)
Discussion started by: cmccabe
0 Replies
LEARN ABOUT DEBIAN
plack::response
Plack::Response(3pm) User Contributed Perl Documentation Plack::Response(3pm)NAME
Plack::Response - Portable HTTP Response object for PSGI response
SYNOPSIS
use Plack::Response;
sub psgi_handler {
my $env = shift;
my $res = Plack::Response->new(200);
$res->content_type('text/html');
$res->body("Hello World");
return $res->finalize;
}
DESCRIPTION
Plack::Response allows you a way to create PSGI response array ref through a simple API.
METHODS
new
$res = Plack::Response->new;
$res = Plack::Response->new($status);
$res = Plack::Response->new($status, $headers);
$res = Plack::Response->new($status, $headers, $body);
Creates a new Plack::Response object.
status
$res->status(200);
$status = $res->status;
Sets and gets HTTP status code. "code" is an alias.
headers
$headers = $res->headers;
$res->headers([ 'Content-Type' => 'text/html' ]);
$res->headers({ 'Content-Type' => 'text/html' });
$res->headers( HTTP::Headers->new );
Sets and gets HTTP headers of the response. Setter can take either an array ref, a hash ref or HTTP::Headers object containing a list
of headers.
body
$res->body($body_str);
$res->body([ "Hello", "World" ]);
$res->body($io);
Gets and sets HTTP response body. Setter can take either a string, an array ref, or an IO::Handle-like object. "content" is an alias.
Note that this method doesn't automatically set Content-Length for the response. You have to set it manually if you want, with the
"content_length" method (see below).
header
$res->header('X-Foo' => 'bar');
my $val = $res->header('X-Foo');
Shortcut for "$res->headers->header".
content_type, content_length, content_encoding
$res->content_type('text/plain');
$res->content_length(123);
$res->content_encoding('gzip');
Shortcut for the equivalent get/set methods in "$res->headers".
redirect
$res->redirect($url);
$res->redirect($url, 301);
Sets redirect URL with an optional status code, which defaults to 302.
Note that this method doesn't normalize the given URI string. Users of this module have to be responsible about properly encoding URI
paths and parameters.
location
Gets and sets "Location" header.
Note that this method doesn't normalize the given URI string in the setter. See above in "redirect" for details.
cookies
$res->cookies->{foo} = 123;
$res->cookies->{foo} = { value => '123' };
Returns a hash reference containing cookies to be set in the response. The keys of the hash are the cookies' names, and their
corresponding values are a plain string (for "value" with everything else defaults) or a hash reference that can contain keys such as
"value", "domain", "expires", "path", "httponly", "secure".
"expires" can take a string or an integer (as an epoch time) and does not convert string formats such as "+3M".
$res->cookies->{foo} = {
value => 'test',
path => "/",
domain => '.example.com',
expires => time + 24 * 60 * 60,
};
finalize
$res->finalize;
Returns the status code, headers, and body of this response as a PSGI response array reference.
AUTHOR
Tokuhiro Matsuno
Tatsuhiko Miyagawa
SEE ALSO
Plack::Request
perl v5.14.2 2012-06-21 Plack::Response(3pm)