Hi
I have a input file in the format
ABC,111,2008Q2, 49K
ABC,111,2008Q3, 0K
ABC,111,2008Q4, 0K
ABC,222,2008Q2, 49K
ABC,222,2008Q3, 0K
ABC,222,2008Q4, 0K
XYZ,111,2008Q2, 49K
XYZ,111,2008Q3, 0K
XYZ,111,2008Q4, 0K
XYZ,222,2008Q2, 49K
XYZ,222,2008Q3, 0K
XYZ,222,2008Q4, 0K
The output file... (3 Replies)
Hi I have an input file and I want to transpose it but I need to take care that if any field is missing for a record it should be popoulated with space for that field - using a shell script
INFILE
----------
emp=1
sal=2
loc=abc
emp=2
sal=21
sal=22
loc=xyz
emp=5
loc=abc
OUTFILE... (10 Replies)
Hi I need a bash shell script that will take text files with 4 rows and different numbers of columns in each row and convert each one into a text file with just one column.
I then subtract 1.5 from each number in the column (I have that part already)
The next step after that is I want to have... (10 Replies)
I have done a couple of searches on this and have found many threads but I don't think I've found one that is useful to me - probably because I have very basic comprehension of perl and beginners shell so trying to manipulate a script already posted maybe beyond my capabilities....
Anyway - I... (26 Replies)
We receive a file which usually has 40 to 50 million rows. I want to set up an audit process by which everytime we receive a file we audit it for # of rows and total number of columns.
So if the # of rows is around 1 million on a particular day, I want to raise a flag or send an email....and if... (3 Replies)
Hello,
I have a huge tab delimited file with around 40,000 columns and 900 rows I want to convert columns to a row.
INPUT file look like this.
the first line is a headed of a file.
ID marker1 marker2 marker3 marker4
b1 A G A C ... (5 Replies)
Hi,
I'd like to swap the columns 1 and 2 of a space-delimited text file but only for the first 1000 rows. How do I go about doing that? Thanks! (1 Reply)
Hi,
I have a requirement to convert rows into columns. data looks like:
c1,c2,c3,..
r1,r2,r3,..
p1,p2,p3,..
and so on..
output shud be like this:
c1,r1,p1,..
c2,r2,p2,..
c3,r3,p3,..
Thanks in advance, (12 Replies)
Hi Friends,
I have come across some files where some of the columns don not have data.
Key, Data1,Data2,Data3,Data4,Data5
A,5,6,,10,,
A,3,4,,3,,
B,1,,4,5,,
B,2,,3,4,,
If we see the above data on Data5 column do not have any row got filled. So remove only that column(Here Data5) and... (4 Replies)
Exporter::Lite(3pm) User Contributed Perl Documentation Exporter::Lite(3pm)NAME
Exporter::Lite - Lightweight exporting of variables
SYNOPSIS
package Foo;
use Exporter::Lite;
# Just like Exporter.
@EXPORT = qw($This That);
@EXPORT_OK = qw(@Left %Right);
# Meanwhile, in another piece of code!
package Bar;
use Foo; # exports $This and &That.
DESCRIPTION
This is an alternative to Exporter intended to provide a lightweight subset of its functionality. It supports "import()", @EXPORT and
@EXPORT_OK and not a whole lot else.
Unlike Exporter, it is not necessary to inherit from Exporter::Lite (ie. no "@ISA = qw(Exporter::Lite)" mantra). Exporter::Lite simply
exports its import() function. This might be called a "mix-in".
Setting up a module to export its variables and functions is simple:
package My::Module;
use Exporter::Lite;
@EXPORT = qw($Foo bar);
now when you "use My::Module", $Foo and "bar()" will show up.
In order to make exporting optional, use @EXPORT_OK.
package My::Module;
use Exporter::Lite;
@EXPORT_OK = qw($Foo bar);
when My::Module is used, $Foo and "bar()" will not show up. You have to ask for them. "use My::Module qw($Foo bar)".
Methods
Export::Lite has one public method, import(), which is called automaticly when your modules is use()'d.
In normal usage you don't have to worry about this at all.
import
Some::Module->import;
Some::Module->import(@symbols);
Works just like "Exporter::import()" excepting it only honors @Some::Module::EXPORT and @Some::Module::EXPORT_OK.
The given @symbols are exported to the current package provided they are in @Some::Module::EXPORT or @Some::Module::EXPORT_OK.
Otherwise an exception is thrown (ie. the program dies).
If @symbols is not given, everything in @Some::Module::EXPORT is exported.
DIAGNOSTICS
'"%s" is not exported by the %s module'
Attempted to import a symbol which is not in @EXPORT or @EXPORT_OK.
'Can't export symbol: %s'
Attempted to import a symbol of an unknown type (ie. the leading $@% salad wasn't recognized).
BUGS and CAVEATS
Its not yet clear if this is actually any lighter or faster than Exporter. I know its at least on par.
OTOH, the docs are much clearer and not having to say "@ISA = qw(Exporter)" is kinda nice.
AUTHORS
Michael G Schwern <schwern@pobox.com>
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
SEE ALSO
Exporter, Exporter::Simple, UNIVERSAL::exports
perl v5.10.0 2006-11-11 Exporter::Lite(3pm)