We need to add header like below .
col1|col2|col3|col4|col5|col6|col7|col8|col9|col10|col11|col12|col13|col14|col15|col16|col17|col18|c ol19|col20|col21|col22|col23|col24|col25|col26
If anyone can help me in this regard ,this will be highly beneficial for me.Thanks .
Hello STCET22,
Following may help you in same.
Output will be as follows.
Thanks,
R. Singh
Dear All,
I need to add a header of one line to an already existing file.
I know that it can be achieved by the following:
echo "Header" > newfile
cat file1 >> newfile
But my problem is that file is huge and there is no space for creating a new file every time. Is there a way that I can... (5 Replies)
Hello,
I’m trying to add a row that will server as the header for a space separated file.
1-I have a number of files save in a directory
2- grep text path/*.log > newfile
newfile looks like this
Field1 Field2 Field3 Field4
Field1 Field2 Field3 Field4
Field1 Field2 Field3 Field4
Field1... (2 Replies)
Hi,
I need a help in creating a report file.
The input file is like this
1 A
2 B
3 V
4 X
5 m
6 O
7 X
8 p
9 a
10 X
There is a header which i have to print & save the result as a output file.
The header has multiple lines on is like say:
New New
S.No Name (15 Replies)
Hi All,
I have a file example.csv which looks like this
GrpID,TargetID,Signal,Avg_Num
CSCH74_1_1,2007,61,256
CSCH74_1_1,212007,647,679
CSCH74_1_1,12007,3,32
CSCH74_1_1,207,299,777
I want the output as
GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num
CSCH74_1_1,2007,61,256... (4 Replies)
Hi All,
I have a file example.csv which looks like this
GrpID,TargetID,Signal,Avg_Num
CSCH74_1_1,2007,61,256
CSCH74_1_1,212007,647,679
CSCH74_1_1,12007,3,32
CSCH74_1_1,207,299,777
I want the output as
GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num
CSCH74_1_1,2007,61,256... (1 Reply)
How can we a shell script and pass date parameters .I have 3 files comming from Datastage with |" delimited
I need append 3 files as above: File1:
P0000|"47416954|"AU|"000|"INS|"0000|"|"20060601|"99991231|"|"|"|"|"01
File 2:... (2 Replies)
Hi,
I want to add the below Header to all the files in sequence File1,File2,File3...etc
"ABC,<number of chracter in the file>"
e,g - If File1 is as below
pqrstuvdt
abcdefgh
then I want to add the above header into it ,So that File1 becomes as below
ABC,17
pqrstuvdt
abcdefgh
... (9 Replies)
Hi team,
In my script i am storing some value in a variable "header".
I want to add the header value has header in a file.
Please help me on this
Thanks in advance,
Baski (4 Replies)
for example, i have a file with below content:
123413
866688
816866
818818
i want the output as:
This is header
123413
866688
816866
818818
This is trailer
i am able to achieve it using a bash script. (2 Replies)
Hi Folks,
I have a file like:
mainfile.txt:
-------------
file1 abc def xyz
file1 aaa pqr xyz
file2 lmn ghi xyz
file2 bbb tuv xyz
I need output having two files file1 and file2.
file1:
------
Name State Country
abc def xyz
aaa pqr xyz
file2: (3 Replies)
Discussion started by: tanmay.gemini
3 Replies
LEARN ABOUT DEBIAN
html::headparser
HTML::HeadParser(3pm) User Contributed Perl Documentation HTML::HeadParser(3pm)NAME
HTML::HeadParser - Parse <HEAD> section of a HTML document
SYNOPSIS
require HTML::HeadParser;
$p = HTML::HeadParser->new;
$p->parse($text) and print "not finished";
$p->header('Title') # to access <title>....</title>
$p->header('Content-Base') # to access <base href="http://...">
$p->header('Foo') # to access <meta http-equiv="Foo" content="...">
$p->header('X-Meta-Author') # to access <meta name="author" content="...">
$p->header('X-Meta-Charset') # to access <meta charset="...">
DESCRIPTION
The "HTML::HeadParser" is a specialized (and lightweight) "HTML::Parser" that will only parse the <HEAD>...</HEAD> section of an HTML
document. The parse() method will return a FALSE value as soon as some <BODY> element or body text are found, and should not be called
again after this.
Note that the "HTML::HeadParser" might get confused if raw undecoded UTF-8 is passed to the parse() method. Make sure the strings are
properly decoded before passing them on.
The "HTML::HeadParser" keeps a reference to a header object, and the parser will update this header object as the various elements of the
<HEAD> section of the HTML document are recognized. The following header fields are affected:
Content-Base:
The Content-Base header is initialized from the <base href="..."> element.
Title:
The Title header is initialized from the <title>...</title> element.
Isindex:
The Isindex header will be added if there is a <isindex> element in the <head>. The header value is initialized from the prompt
attribute if it is present. If no prompt attribute is given it will have '?' as the value.
X-Meta-Foo:
All <meta> elements containing a "name" attribute will result in headers using the prefix "X-Meta-" appended with the value of the
"name" attribute as the name of the header, and the value of the "content" attribute as the pushed header value.
<meta> elements containing a "http-equiv" attribute will result in headers as in above, but without the "X-Meta-" prefix in the header
name.
<meta> elements containing a "charset" attribute will result in an "X-Meta-Charset" header, using the value of the "charset" attribute
as the pushed header value.
METHODS
The following methods (in addition to those provided by the superclass) are available:
$hp = HTML::HeadParser->new
$hp = HTML::HeadParser->new( $header )
The object constructor. The optional $header argument should be a reference to an object that implement the header() and push_header()
methods as defined by the "HTTP::Headers" class. Normally it will be of some class that is a or delegates to the "HTTP::Headers"
class.
If no $header is given "HTML::HeadParser" will create an "HTTP::Headers" object by itself (initially empty).
$hp->header;
Returns a reference to the header object.
$hp->header( $key )
Returns a header value. It is just a shorter way to write "$hp->header->header($key)".
EXAMPLE
$h = HTTP::Headers->new;
$p = HTML::HeadParser->new($h);
$p->parse(<<EOT);
<title>Stupid example</title>
<base href="http://www.linpro.no/lwp/">
Normal text starts here.
EOT
undef $p;
print $h->title; # should print "Stupid example"
SEE ALSO
HTML::Parser, HTTP::Headers
The "HTTP::Headers" class is distributed as part of the libwww-perl package. If you don't have that distribution installed you need to
provide the $header argument to the "HTML::HeadParser" constructor with your own object that implements the documented protocol.
COPYRIGHT
Copyright 1996-2001 Gisle Aas. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2011-10-15 HTML::HeadParser(3pm)