I have below perl script which writes xml from .xls file.
Now i want to add below two conditions in this script :
1. to check if the the input .xls file has ony two columns , if more tahn two columns then script should pop up an error.
2. If there are two columns , then first column should have header 'ID' and second column as 'Name' , if this is not the case then script should fire an error.
Here is my code :
Can someone please help me in adding these two condition in it.
How do I add 4 columns to an excel file using Perl? The 4 headers for those columns will all have different names? Please help and I greatly appreciate... (1 Reply)
Hi everybody,
This time I am having one issue in perl.
I have to create comma separated file using the following type of information. The problem is the columns do not have any specific delimiter. So while using split I am getting different value. Some where it is space(S) and some where it is... (9 Replies)
Hi,
I am trying to find a way to read an excel work book with multiple worksheets.
And write each worksheet into a new excel file using perl. My environment is Unix.
For example: I have an excel workbook TEST.xls and it has Sheet1, Sheet2, Sheet3 worksheets. I would like to create... (2 Replies)
Hello!
I need to sort a file that is partly in English partly in Bulgarian.
The original file is an Excel file but I converted it to a tab-delimited text file. The encoding of the tab delimited file is UTF-8.
To sort the text, the script should test every line of the text file to see if... (9 Replies)
Hi all,
I want to read some specific rows & columns in the .xls file with my script to get the data to be manipulated. Now, I can read the .xls file correctly & i can go to the specific sheet that I want but i have a problem to specify the specific rows & columns. I mean, I want to get the info... (0 Replies)
I have a shell script like this:
#!/bin/sh
$PYTHON MetarDecoder.py < ../data/mtrs/arg1/arg2
And I'm calling it with this in perl:
my $output = `./metar_parse.sh --options`;
It's successful when I put in actual values for arg1 and arg2 in the shell script, but I'd like to pass arguments... (1 Reply)
All,
I have an excel sheet Excel1.xls that has some entries.
I have one more excel sheet Excel2.xls that has entries only in those cells which are blank in Excel1.xls
These may be in different workbooks. They are totally independent made by 2 different users.
I have placed them in a... (1 Reply)
Hi All...
I am in need of few columns from a log file.. in .xls file... below is what i have tried.
my log file has 16 colums with " ; " as delimiter, but i need randomn columns 1 2 3 4 5 6 10 11 16 in an excel.
I tried to awk the columns with delimiter ; and it worked, below is the log... (5 Replies)
Hi All,
I want to read an excel file.
PFA excel, I want to read the cloumn from A to G and the V to AH
starting from Row number 3.
Please help me on this. (7 Replies)
Hi, I have a shell script which analyses the log folder for a specific string and throws me the output. I have used for loop since it does this in multiple servers. Now I want to save the output in a excel in the below format. Can someone please help?
The output which I get
Server1 : count... (14 Replies)
Discussion started by: srilaxman
14 Replies
LEARN ABOUT DEBIAN
xml::writer::string
String(3pm) User Contributed Perl Documentation String(3pm)NAME
XML::Writer::String - Capture output from XML::Writer.
SYNOPSIS
use XML::Writer;
use XML::Writer::String;
my $s = XML::Writer::String->new();
my $writer = new XML::Writer( OUTPUT => $s );
$writer->xmlDecl();
$writer->startTag('root');
$writer->endTag();
$writer->end();
print $s->value();
DESCRIPTION
This module implements a bare-bones class specifically for the purpose of capturing data from the XML::Writer module. XML::Writer expects
an IO::Handle object and writes XML data to the specified object (or STDOUT) via it's print() method. This module simulates such an object
for the specific purpose of providing the required print() method.
It is recommended that $writer->end() is called prior to calling $s->value() to check for well-formedness.
METHODS
XML::Writer::String provides three methods, "new()", "print()" and "value()":
"$s = XML::Writer::String-"new([list]);>
new() returns a new String handle.
"$count = $s-"print([list]);>
print() appends concatenated list data and returns number of items in list.
"$val = $s-"value([list]);>
value() returns the current content of the object as a scalar. It can also be used to initialize/overwrite the current content with
concatenated list data.
NOTES
This module is designed for the specific purpose of capturing the output of XML::Writer objects, as described in this document. It does
not inherit form IO::Handle. For an alternative solution look at IO::Scalar, IO::Lines, IO::String or Tie::Handle::Scalar.
AUTHOR
Simon Oliver <simon.oliver@umist.ac.uk>
COPYRIGHT
Copyright (C) 2002 Simon Oliver
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
XML::Writer, IO::Handle, IO::Scalar
perl v5.14.2 2002-03-06 String(3pm)