Hi,
I have this text in a file where I need to move part of the text....
<Relation1 OriginatingObjectID="Holding_1" RelatedObjectID="Party_1" id="Relation_1">
<OriginatingObjectType tc="4">Holding</OriginatingObjectType>
<RelatedObjectType tc="6">Party</RelatedObjectType>... (4 Replies)
Hi,
I want to extract a part of filename and pass it as a parameter to one of the scripts. Could someone help.
File name:-
NLL_NAM_XXXXX.XXXXXXX_1_1.txt.
Here i have to extract only XXXXX.XXXXXXX and the position will be constant. that means that i have to extract some n characters from... (6 Replies)
Hi there,
I'm having some problem with UNIX scripting (ksh), perhaps somebody can help me out?
For example:
------------
Sample content of my log file (text file):
--------------------------------------
File1: ....
info_1 ...
info_2 ...
info_3 ...
File2: ....
info_1 ...
info_2 ...... (10 Replies)
needa c program to extract text between two delimiters from some text file.
and then storing them in to diffrent variables ?
text file like 0:
abc.txt
=========
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass... (7 Replies)
Hi guys
So I have a very large log file where each event is logged along with the time that it occurred.
So for e.g. The contents of the file look like:
...
12:00:07 event 0 happened.
12:01:01 event 1 happened.
12:01:05 event 2 happened.
12:01:30 event 3 happened.
12:02:01 event 4... (10 Replies)
Hello All,
I need to extract part of a file into a new file
My file is
Define schema xxxxxx
Insert into table
(
a
,b
,c
,d
)
values
(
1,
2,
3, (15 Replies)
I have a text file, input.fasta contains some protein sequences. input.fasta is shown below.
>P02649
MKVLWAALLVTFLAGCQAKVEQAVETEPEPELRQQTEWQSGQRWELALGRFWDYLRWVQT
LSEQVQEELLSSQVTQELRALMDETMKELKAYKSELEEQLTPVAEETRARLSKELQAAQA
RLGADMEDVCGRLVQYRGEVQAMLGQSTEELRVRLASHLRKLRKRLLRDADDLQKRLAVY... (8 Replies)
I need to save part of a file to a different one, start and end offset bytes are provided by two counters in long format. If the difference is big, how should I do it to prevent buffer overflow in java? (7 Replies)
I have a variable and assigned the following values
***XYZ_201519_20150929140642_20150929140644_211_0_0_211
I need to read this variable from backward and stop read when I get first underscore (_)
In this scenario I should get 211
Thanks
Kris (3 Replies)
Hi,
I need to extract part of a text to two variables
text is
"PL/SQL procedure successfully completed. ERROR ----------------------------------------------------------------- Test Error Message PLUSVAR ---------- 1"
I want "Test Error Message" in one variable and "1" in another variable.... (11 Replies)
Discussion started by: vedavrath
11 Replies
LEARN ABOUT MOJAVE
http::headers::util
HTTP::Headers::Util(3) User Contributed Perl Documentation HTTP::Headers::Util(3)NAME
HTTP::Headers::Util - Header value parsing utility functions
SYNOPSIS
use HTTP::Headers::Util qw(split_header_words);
@values = split_header_words($h->header("Content-Type"));
DESCRIPTION
This module provides a few functions that helps parsing and construction of valid HTTP header values. None of the functions are exported
by default.
The following functions are available:
split_header_words( @header_values )
This function will parse the header values given as argument into a list of anonymous arrays containing key/value pairs. The function
knows how to deal with ",", ";" and "=" as well as quoted values after "=". A list of space separated tokens are parsed as if they
were separated by ";".
If the @header_values passed as argument contains multiple values, then they are treated as if they were a single value separated by
comma ",".
This means that this function is useful for parsing header fields that follow this syntax (BNF as from the HTTP/1.1 specification, but
we relax the requirement for tokens).
headers = #header
header = (token | parameter) *( [";"] (token | parameter))
token = 1*<any CHAR except CTLs or separators>
separators = "(" | ")" | "<" | ">" | "@"
| "," | ";" | ":" | "" | <">
| "/" | "[" | "]" | "?" | "="
| "{" | "}" | SP | HT
quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
qdtext = <any TEXT except <">>
quoted-pair = "" CHAR
parameter = attribute "=" value
attribute = token
value = token | quoted-string
Each header is represented by an anonymous array of key/value pairs. The keys will be all be forced to lower case. The value for a
simple token (not part of a parameter) is "undef". Syntactically incorrect headers will not necessarily be parsed as you would want.
This is easier to describe with some examples:
split_header_words('foo="bar"; port="80,81"; DISCARD, BAR=baz');
split_header_words('text/html; charset="iso-8859-1"');
split_header_words('Basic realm="\"foo\\bar\""');
will return
[foo=>'bar', port=>'80,81', discard=> undef], [bar=>'baz' ]
['text/html' => undef, charset => 'iso-8859-1']
[basic => undef, realm => ""foo\bar""]
If you don't want the function to convert tokens and attribute keys to lower case you can call it as "_split_header_words" instead
(with a leading underscore).
join_header_words( @arrays )
This will do the opposite of the conversion done by split_header_words(). It takes a list of anonymous arrays as arguments (or a list
of key/value pairs) and produces a single header value. Attribute values are quoted if needed.
Example:
join_header_words(["text/plain" => undef, charset => "iso-8859/1"]);
join_header_words("text/plain" => undef, charset => "iso-8859/1");
will both return the string:
text/plain; charset="iso-8859/1"
COPYRIGHT
Copyright 1997-1998, Gisle Aas
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.18.2 2012-02-16 HTTP::Headers::Util(3)