Hi,
I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value .
For Eg .
if the input file has a row :
abc xyz lmn 89 lm nk o p
I would like the script to create something like... (9 Replies)
Hi All,
The following is the scenario
id name
--------------
1 William;Johnson
2 Azim;Abdul
3 Grasim
.
.
etc....
I need the following output
id name
--------------
1 William
1 Johnson
2 Azim (2 Replies)
Guys -- I am noob and I am really strugging on this one. I cant even write the pseudo code for it. I have a file that spits values in individual rows as such:
file:
user date type size
joe 2005-25-09 log 1
joe 2005-25-09 snd 10
joe 2005-25-09 rcd 12
joe 2005-24-09 log 2
joe... (1 Reply)
I want to write a scrpit to merge files row wise (actually concatinating)
main.txt
X Y Z
file 1
A B C
file 2
1 2 3
now i want the script to check if the file1 is empty or not, if empty then make it like
A B C
1 2 3
again to check if second file is empty if not do as done... (0 Replies)
Hello Everyone,
My issue is that I want to traverse a database table row by row and do some action on the value retrieved in each row.
I have gone through a lot of shell script questions/posts. I could find row by row traversal of a file but not a database table.
Please help.
Thanks &... (5 Replies)
Hi Friends,
I have a single column data like below.
1
2
3
4
5
I need the output like below.
0
1
2
3
4
where each row (including first row) subtracting from first row and the result should print below like the way shown in output file.
Thanks
Sid (11 Replies)
Comparing two files on row by row
File1
ecount~100
dcount~200
ccount~300
zxcscount~5000
and so on.
File2
ecount~100
dcount~203
ccount~300
zxcscount~5000
and so on.
If i use diff command (1 Reply)
My original files are like this below and I distinguish them from the AP_ID (file1 has 572 and file2 has 544). Also, the header on file1 has “G_” pre-pended. NOTE: these are only snippets of very large files and much of the data is not present here.
Original File 1:
... (36 Replies)
Hi ALL,
We have requirement in a file, i have multiple rows.
Example below:
Input file rows
01,1,102319,0,0,70,26,U,1,331,000000113200000011920000001212
01,1,102319,0,1,80,20,U,1,241,00000059420000006021
I need my output file should be as mentioned below. Last field should split for... (4 Replies)
This is a question that is related to one I had last August when I was trying to sort/merge two files by millsecond time column (in this case column 6).
The script (below) that helped me last august by RudiC solved the puzzle of sorting/merging two files by time, except it gets lost when the... (0 Replies)
Discussion started by: aachave1
0 Replies
LEARN ABOUT DEBIAN
dbix::class::helper::row::subclass
DBIx::Class::Helper::Row::SubClass(3pm) User Contributed Perl Documentation DBIx::Class::Helper::Row::SubClass(3pm)NAME
DBIx::Class::Helper::Row::SubClass - Convenient subclassing with DBIx::Class
VERSION
version 2.013002
SYNOPSIS
# define parent class
package ParentSchema::Result::Bar;
use strict;
use warnings;
use parent 'DBIx::Class';
__PACKAGE__->load_components('Core');
__PACKAGE__->table('Bar');
__PACKAGE__->add_columns(qw/ id foo_id /);
__PACKAGE__->set_primary_key('id');
__PACKAGE__->belongs_to( foo => 'ParentSchema::Result::Foo', 'foo_id' );
# define subclass
package MySchema::Result::Bar;
use strict;
use warnings;
use parent 'ParentSchema::Result::Bar';
__PACKAGE__->load_components(qw{Helper::Row::SubClass Core});
__PACKAGE__->subclass;
or with DBIx::Class::Candy:
# define subclass
package MySchema::Result::Bar;
use DBIx::Class::Candy
-base => 'ParentSchema::Result::Bar',
-components => ['Helper::Row::SubClass'];
subclass;
DESCRIPTION
This component is to allow simple subclassing of DBIx::Class Result classes.
METHODS
subclass
This is probably the method you want. You call this in your child class and it imports the definitions from the parent into itself.
generate_relationships
This is where the cool stuff happens. This assumes that the namespace is laid out in the recommended "MyApp::Schema::Result::Foo" format.
If the parent has "Parent::Schema::Result::Foo" related to "Parent::Schema::Result::Bar", and you inherit from
"Parent::Schema::Result::Foo" in "MyApp::Schema::Result::Foo", you will automatically get the relationship to "MyApp::Schema::Result::Bar".
set_table
This is a super basic method that just sets the current classes' table to the parent classes' table.
CANDY EXPORTS
If used in conjunction with DBIx::Class::Candy this component will export:
join_table
subclass
generate_relationships
set_table
NOTE
This Component is mostly aimed at those who want to subclass parts of a schema, maybe for sharing a login system in a few different
projects. Do not confuse it with DBIx::Class::DynamicSubclass, which solves an entirely different problem. DBIx::Class::DynamicSubclass
is for when you want to store a few very similar classes in the same table (Employee, Person, Boss, etc) whereas this component is merely
for reusing an existing schema.
AUTHOR
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Arthur Axel "fREW" Schmidt.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-06-18 DBIx::Class::Helper::Row::SubClass(3pm)