02-23-2013
Hi elixir sinari,
I have a list of files and the output for each file is different,
bc_attribute_rec.tps,
bc_attribute_update.tps
bc_attribute_update_arr.tps
output of the files
bc_attribute_rec_to_txn.tps,
bc_attribute_update_to_txn.tps
bc_attribute_update_arr_to_txn.tps
so how do I achieve it?
thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to find socail security numbers in files in (and under) a specific directory and output a list of the files where they are found... the format would be with no dashes just 9 numeric characters in a row.
I have tried this:
find /DirToLookIn -exec grep '\{9\}' /dev/null {} \; >>... (1 Reply)
Discussion started by: NewSolarisAdmin
1 Replies
2. Shell Programming and Scripting
Hi
I need to execute a select statement in a solaris environment with oracle database. The select statement returns number of rows of data.
I need the data to be inserted into a CSV file with proper format. For that we normally use "You have to select all your columns as one big string,... (2 Replies)
Discussion started by: rdhanek
2 Replies
3. Shell Programming and Scripting
Hi,
(Oracle, AIX)
I have googled this and searched this forum, however I haven't had much luck with an answer and have tried several different things.
Basically I have a SQL select statement which generates a whole load of UPDATE statements, I want to run the select statement via... (13 Replies)
Discussion started by: dbchud
13 Replies
4. UNIX Desktop Questions & Answers
i m trying to write a script that will print all the txt files at /home/ directory
and will allow a selection of a file and then print the file name.
this is what i wrote so far:
echo "please select the file from the list "
list=$(ls -f *.txt /home/)
array=( )
for machine in $list
doat... (1 Reply)
Discussion started by: boaz733
1 Replies
5. UNIX for Dummies Questions & Answers
Hi guys,
brand new to this thread and very very new to UNIX...so go easy please!
Anyway I have a file that looks like this:
>>--------------------------------------------------------------------------
Date/Time/Eng. : 2012-06-22 / 00:26 / DS
Reported problem : (SD) ... (5 Replies)
Discussion started by: martin0852
5 Replies
6. Shell Programming and Scripting
Hello
I have a large file1 which has many events like "2014010420" and following lines under each event that start with text . It has this form:
2014010420 num --- --- num ....
NTE num num --- num...
EFA num num --- num ...
LASW num num --- num... (9 Replies)
Discussion started by: phaethon
9 Replies
7. UNIX for Dummies Questions & Answers
Hi
How can I extract sequences from a fasta file with respect a certain criteria? The beginning of my file (containing in total more than 1000 sequences) looks like this:
>H8V34IS02I59VP
SDACNDLTIALLQIAREVRVCNPTFSFRWHPQVKDEVMRECFDCIRQGLG
YPSMRNDPILIANCMNWHGHPLEEARQWVHQACMSPCPSTKHGFQPFRMA... (6 Replies)
Discussion started by: Marion MPI
6 Replies
8. Shell Programming and Scripting
Hi ,
I'm trying to list the files and output is written to a file. But when I execute the command , the output file is being listed. How to exclude it ?
/tmp
file1.txt
file2.txt
ls -ltr |grep -v '-' | awk print {$9, $5} > output.txt
cat output.txt
file1.txt
file2.txt
output.txt (8 Replies)
Discussion started by: etldeveloper
8 Replies
9. Shell Programming and Scripting
Hi experts,
I am using KSH and I am need to display file with number in front of file names and user can select it by entering the number.
I am trying to use following command to display list with numbers. but I do not know how to capture number and identify what file it is to be used for... (5 Replies)
Discussion started by: mysocks
5 Replies
10. Shell Programming and Scripting
I am trying to have the user select two files from a numbered list which will eventually be turned into a variable then combined. This is probably something simple and stupid that I am doing.
clear
echo "Please Select the Show interface status file"
select FILE1 in *;
echo "Please Select the... (3 Replies)
Discussion started by: dis0wned
3 Replies
LEARN ABOUT OSX
moose::cookbook::basics::recipe6
Moose::Cookbook::Basics::Recipe6(3) User Contributed Perl Documentation Moose::Cookbook::Basics::Recipe6(3)
NAME
Moose::Cookbook::Basics::Recipe6 - The augment/inner example
VERSION
version 2.0205
SYNOPSIS
package Document::Page;
use Moose;
has 'body' => ( is => 'rw', isa => 'Str', default => sub {''} );
sub create {
my $self = shift;
$self->open_page;
inner();
$self->close_page;
}
sub append_body {
my ( $self, $appendage ) = @_;
$self->body( $self->body . $appendage );
}
sub open_page { (shift)->append_body('<page>') }
sub close_page { (shift)->append_body('</page>') }
package Document::PageWithHeadersAndFooters;
use Moose;
extends 'Document::Page';
augment 'create' => sub {
my $self = shift;
$self->create_header;
inner();
$self->create_footer;
};
sub create_header { (shift)->append_body('<header/>') }
sub create_footer { (shift)->append_body('<footer/>') }
package TPSReport;
use Moose;
extends 'Document::PageWithHeadersAndFooters';
augment 'create' => sub {
my $self = shift;
$self->create_tps_report;
inner();
};
sub create_tps_report {
(shift)->append_body('<report type="tps"/>');
}
# <page><header/><report type="tps"/><footer/></page>
my $report_xml = TPSReport->new->create;
DESCRIPTION
This recipe shows how the "augment" method modifier works. This modifier reverses the normal subclass to parent method resolution order.
With an "augment" modifier the least specific method is called first. Each successive call to "inner" descends the inheritance tree, ending
at the most specific subclass.
The "augment" modifier lets you design a parent class that can be extended in a specific way. The parent provides generic wrapper
functionality, and the subclasses fill in the details.
In the example above, we've created a set of document classes, with the most specific being the "TPSReport" class.
We start with the least specific class, "Document::Page". Its create method contains a call to "inner()":
sub create {
my $self = shift;
$self->open_page;
inner();
$self->close_page;
}
The "inner" function is exported by "Moose", and is like "super" for augmented methods. When "inner" is called, Moose finds the next method
in the chain, which is the "augment" modifier in "Document::PageWithHeadersAndFooters". You'll note that we can call "inner" in our
modifier:
augment 'create' => sub {
my $self = shift;
$self->create_header;
inner();
$self->create_footer;
};
This finds the next most specific modifier, in the "TPSReport" class.
Finally, in the "TPSReport" class, the chain comes to an end:
augment 'create' => sub {
my $self = shift;
$self->create_tps_report;
inner();
};
We do call the "inner" function one more time, but since there is no more specific subclass, this is a no-op. Making this call means we can
easily subclass "TPSReport" in the future.
CONCLUSION
The "augment" modifier is a powerful tool for creating a set of nested wrappers. It's not something you will need often, but when you do,
it is very handy.
AUTHOR
Stevan Little <stevan@iinteractive.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Infinity Interactive, Inc..
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.12.5 2011-09-06 Moose::Cookbook::Basics::Recipe6(3)