hello
have a file1
H87I
Y788O
T347U
J23U
and
file2 J23U U887Y I99U T556U
file3 I99O J99T F557J
file4 N99I T666U R55Y
file5 H87I T347U
file6 H77U R556Y E44T
file7 Y788O K98U H8I
May be using script we can use file1 to search for all the files
and have the output
H87I file5... (3 Replies)
Hi,
I am having a file which contains as below
Names(aaaa
,bbbb
,cccc
,dddd)
now i want the file to be updated with new value 'eeee' as below
Names(aaaa
,bbbb
,cccc
,dddd
,eeee)
Is there a way to script this ?
Thanks, (5 Replies)
HI All,
I have a text file memory.txt which has following values.
Average: 822387 7346605 89.93 288845 4176593 2044589 51883 2.47 7600
i want to convert this file in csv format and i am using following command to do it.
sed s/_/\./g <... (3 Replies)
Hello
Has anyone got an example shell script that I can use to compare the contents of two files.
The files should contain the same contents, eg.
file1.txt
apple
pear
grape
file2.txt
apple
pear
grape (2 Replies)
Hi,
This is my DOS Batch file.
@echo off
echo "Program Name :" %0
rem echo "Next param :" %1
echo "Next param :" "Username/Password"
echo "User Id :" %2
echo "User Name :" %3
echo "Request ID ... (4 Replies)
Hi I have a dat file which has "n" number of columns. The file is delimited. The number of columns keep varying as the file is generated out of DB queries. Could you please help me in writing a script which will generate a XLS or CSV file out of the dat file. (5 Replies)
Hello all,
I have a Kconfig file that looks like something below ...
================================
menu "Application type"
config GUI_TYPE_STANDARD
bool "Standard Application"
source "cfg/config/std.in"
source... (12 Replies)
Hello Unix Shell Script Experts,
I have a script that would mask the columns in .csv file or .txt file.
First the script will untar the .zip files from Archive folder and processes into work folder and finally pushes the masked .csv files into Feed folder.
Two parameters are passed
... (5 Replies)
Shell script logic
Hi
I have 2 input files like with file 1 content as (file1)
"BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt
File 2 contents as fle(2)
"BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt
I want to get... (22 Replies)
Like to have shell script to Read the given file contents into a merged one file with header of path+file name followed by file contents into a single output file.
While reading and merging the file contents into a single file, Like to keep the format of the source file.
... (4 Replies)
Discussion started by: Siva SQL
4 Replies
LEARN ABOUT DEBIAN
class::gomor::hash
Class::Gomor::Hash(3pm) User Contributed Perl Documentation Class::Gomor::Hash(3pm)NAME
Class::Gomor::Hash - class and object builder, hash version
SYNPOSIS
# Create a base class in BaseClass.pm
package My::BaseClass;
require Class::Gomor::Hash;
our @ISA = qw(Class::Gomor::Hash);
our @AS = qw(attribute1 attribute2);
our @AA = qw(attribute3 attribute4);
our @AO = qw(other);
# You should initialize yourself array attributes
sub new { shift->SUPER::new(attribute3 => [], attribute4 => [], @_) }
# Create accessors
My::BaseClass->cgBuildAccessorsScalar(@AS);
My::BaseClass->cgBuildAccessorsArray(@AA);
sub other {
my $self = shift;
@_ ? $self->{'other'} = [ split(/
/, shift) ]
: @{$self->{'other'}};
}
1;
# Create a subclass in SubClass.pm
package My::SubClass;
require My::BaseClass;
our @ISA = qw(My::BaseClass);
our @AS = qw(subclassAttribute);
My::SubClass->cgBuildAccessorsScalar(@AS);
sub new {
shift->SUPER::new(
attribute1 => 'val1',
attribute2 => 'val2',
attribute3 => [ 'val3', ],
attribute4 => [ 'val4', ],
other => [ 'none', ],
subclassAttribute => 'subVal',
);
}
1;
# A program using those classes
my $new = My::SubClass->new;
my $val1 = $new->attribute1;
my @values3 = $new->attribute3;
my @otherOld = $new->other;
$new->other("str1
str2
str3");
my @otherNew = $new->other;
print "@otherNew
";
$new->attribute2('newValue');
$new->attribute4([ 'newVal1', 'newVal2', ]);
DESCRIPTION
This class is a subclass from Class::Gomor. It implements objects as hash references, and inherits methods from Class::Gomor.
GLOBAL VARIABLE
See Class::Gomor.
METHODS
new (hash)
Object constructor. This is where user passed attributes (hash argument) are checked against valid attributes (gathered by
cgGetAttributes method). Valid attributes are those that exists (doh!), and have not an undef value. The default is to check this, you
can avoid it by setting $NoCheck global variable (see perldoc Class::Gomor).
cgBuildIndices
This method does nothing. It only exists to make it more easy to switch between Class::Gomor::Array and Class::Gomor::Hash.
cgBuildAccessorsScalar (array ref)
cgBuildAccessorsArray (array ref)
See Class::Gomor.
cgGetIndice (scalar)
This method does nearly nothing. It only returns the passed-in scalar parameter (so the syntax is the same as in Class::Gomor::Array).
It only exists to make it more easy to switch between Class::Gomor::Array and Class::Gomor::Hash.
cgClone [ (scalar) ]
You can clone one of your objects by calling this method. An optional parameter may be used to create multiple clones. Cloning will
occure only on the first level attributes, that is, if you have attributes containing other objects, they will not be cloned.
cgFullClone [ (scalar) ]
This method is the same as cgClone, but will clone all attributes recursively, but only if they are subclassed from Class::Gomor. So,
objects created with other modules than Class::Gomor::Array or Class::Gomor::Hash will not be cloned.
Another thing to note, there is no catch for cycling references (when you link two objects with each others). You have been warned.
cgDumper
Will return a string as with Data::Dumper Dumper method. This is less useful for hashref objects, because they already include
attributes names.
SEE ALSO
Class::Gomor
AUTHOR
Patrice <GomoR> Auffret
COPYRIGHT AND LICENSE
Copyright (c) 2004-2009, Patrice <GomoR> Auffret
You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.
perl v5.10.1 2009-05-23 Class::Gomor::Hash(3pm)