10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,,
I have requirement that i need to get DISTINCT values from a table and if there are two records i need to update it to one record and then need to submit INSERT statements by using the updated value as a parameter. Here is the example follows..
SELECT DISTINCT ID FROM OFFER_GROUP WHERE... (1 Reply)
Discussion started by: Samah
1 Replies
2. Shell Programming and Scripting
I have test.xml
<emp><id>101</id><name>AAA</name><date>06/06/14 1811</date></emp>
<Join><id>101</id><city>london</city><date>06/06/14 2011</date></join>
<Join><id>101</id><city>new york</city><date>06/06/14 1811</date></join>
<Join><id>101</id><city>sydney</city><date>06/06/14... (2 Replies)
Discussion started by: vsraju
2 Replies
3. Shell Programming and Scripting
Input file :
AAAG TC
AACCCT AACCCT AACCCT AACCCT
TCTG TCTG TCTG AC AC TCTG TCTG AC AC AC
AC AC
AGTG AC
AGTG TCC
Desired output file :
AACCCT AACCCT AACCCT AACCCT
AC AC
I would like to print out the line that share exactly same as the first column data content.
Column one data... (4 Replies)
Discussion started by: perl_beginner
4 Replies
4. Shell Programming and Scripting
Hi! all
can any one tell me how to compare current record of column with next and previous record in awk without using array
my case is like this
input.txt
0 32
1 26
2 27
3 34
4 26
5 25
6 24
9 23
0 32
1 28
2 15
3 26
4 24 (7 Replies)
Discussion started by: Dona Clara
7 Replies
5. Shell Programming and Scripting
Input file
data_2 USA
data_2 JAPAN
data_3 UK
data_4 Brazil
data_5 Singapore
data_5 Indo
data_5 Thailand
data_6 China
Desired output file
data_2 USA/JAPAN
data_3 UK
data_4 Brazil
data_5 Singapore/Indo/Thailand
data_6 China
I would like to merge all data content that share same... (2 Replies)
Discussion started by: perl_beginner
2 Replies
6. Shell Programming and Scripting
Hi,
Help required to split record value and write to new row.
Input
a~b~c~value in ('3','4','5')~test
output
a~b~c~3~test
a~b~c~4~test
a~b~c~5~test
input
a~b~c~value in ('3','4')~test
output
a~b~c~3~test
a~b~c~4~test (8 Replies)
Discussion started by: Jairaj
8 Replies
7. Shell Programming and Scripting
Input data:
read1_data1
read1_data1
read2_data1
read3_data1
read4_data1
read4_data1
read4_data1
read5_data1
.
.
Desired output result:
read1_data1
read1_data2
read2_data1
read3_data1
read4_data1 (3 Replies)
Discussion started by: perl_beginner
3 Replies
8. Shell Programming and Scripting
Hi,
I have a input file with the following entries:
1one
2two
3three
1four
2five
3six
1seven
1eight
1nine
2ten
The output should be
1one
2two
3three
1four
2five
3six (2 Replies)
Discussion started by: supchand
2 Replies
9. Shell Programming and Scripting
Hi,
I am new to UNIX scripting and woiuld appreicate your help...
Input file contains only one (but long) record:
aaaaabbbbbcccccddddd.....
Desired file:
NEW RECORD #new record (hardcoded) added as first record - its length is irrelevant#
aaaaa
bbbbb
ccccc
ddddd
...
...
... (1 Reply)
Discussion started by: rsolap
1 Replies
10. Shell Programming and Scripting
Hi All
I am very new to the Unix shell scripting ,, could you pleae help me to generate the output file having the filename and path which files having the difference in the contents in the two directory. all files in both directory have the same name and format.
input directory /edc/input1/ ... (3 Replies)
Discussion started by: singhald007
3 Replies
DublinCore::Record(3pm) User Contributed Perl Documentation DublinCore::Record(3pm)
NAME
DublinCore::Record - Container for Dublin Core metadata elements
SYNOPSIS
use DublinCore::Record;
my $record = DublinCore::Record->new();
# later ...
# print the title
print $record->element( 'title' )->content;
## list context will retrieve all of a particular element
foreach my $element ( $record->element( 'Creator' ) ) {
print "creator: ", $element->content(), "
";
}
## qualified dublin core
my $creation = $record->element( 'Date.created' )->content();
DESCRIPTION
DublinCore::Record is an abstract class for manipulating DublinCore metadata. The Dublin Core is a small set of metadata elements for
describing information resources. For more information on embedding DublinCore in HTML see RFC 2731 <http://www.ietf.org/rfc/rfc2731> or
<http://www.dublincore.org/documents/dces/>
METHODS
new()
The constructor. Takes no arguments.
$record = DublinCore::Record->new();
add( @elements )
Adds valid DublinCore::Element objects to the record.
remove( @elements )
Removes valid DublinCore::Element object from the record.
element()
This method will return a relevant DublinCore::Element object. When called in a scalar context element() will return the first relevant
element found, and when called in a list context it will return all the relevant elements (since Dublin Core elements are repeatable).
## retrieve first title element
my $element = $record->element( 'Title' );
my $title = $element->content();
## shorthand object chaining to extract element content
my $title = $record->element( 'Title' )->content();
## retrieve all creator elements
@creators = $record->element( 'Creator' );
You can also retrieve qualified elements in a similar fashion.
my $date = $record->element( 'Date.created' )->content();
In order to fascilitate chaining element() will return an empty DublinCore::Element object when the requested element does not exist. You
can check if you're getting an empty empty back by using the is_empty() method.
if( $record->element( 'title' )->is_empty ) {
# no title
}
elements()
Returns all the Dublin Core elements found as DublinCore::Element objects which you can then manipulate further.
foreach my $element ( $record->elements() ) {
print "name=", $element->name(), "
";
print "content=", $element->content(), "
";
}
title()
Returns a DublinCore::Element object for the title element. You can then retrieve content, qualifier, scheme, lang attributes like so.
my $title = $record->title();
print "content: ", $title->content(), "
";
print "qualifier: ", $title->qualifier(), "
";
print "scheme: ", $title->scheme(), "
";
print "language: ", $title->language(), "
";
Since there can be multiple instances of a particular element type (title, creator, subject, etc) you can retrieve multiple title elements
by calling title() in a list context.
my @titles = $record->title();
foreach my $title ( @titles ) {
print "title: ", $title->content(), "
";
}
creator()
Retrieve creator information in the same manner as title().
subject()
Retrieve subject information in the same manner as title().
description()
Retrieve description information in the same manner as title().
publisher()
Retrieve publisher information in the same manner as title().
contributor()
Retrieve contributor information in the same manner as title().
date()
Retrieve date information in the same manner as title().
type()
Retrieve type information in the same manner as title().
format()
Retrieve format information in the same manner as title().
identifier()
Retrieve identifier information in the same manner as title().
source()
Retrieve source information in the same manner as title().
language()
Retrieve language information in the same manner as title().
relation()
Retrieve relation information in the same manner as title().
coverage()
Retrieve coverage information in the same manner as title().
rights()
Retrieve rights information in the same manner as title().
SEE ALSO
* DublinCore::Element
* Dublin Core <http://www.dublincore.org/>
* RFC 2731 <http://www.ietf.org/rfc/rfc2731>
* perl4lib <http://www.rice.edu/perl4lib>
AUTHOR
* Ed Summers <ehs@pobox.com>
* Brian Cassidy <bricas@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2007 by Ed Summers, Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.8.8 2007-11-24 DublinCore::Record(3pm)