Good idea, but, as you said, cat and paste aren't too flexible. How about this sed / sort approach that collects lines up to an empty one, replaces <newline> with a token (here: <CR> = \r), sorts the output, and undoes the replacement? Be aware that uniq also needs sorted input to work correctly.
. The original order is lost, though, which might not be a problem because the multiple entries seem randomly distributed. To get to something like an order by date, you could try (given your sort version provides the -M option)
Hey Guys,
I have file which looks like this,
Contig201#numbPA
Contig1452#nmdynD6PA
dm022p15.r#CG6461PA
dm005e16.f#SpatPA
IGU001_0015_A06.f#CG17593PA
I need to remove duplicates based on the chracter matching upto '#'.
for example if we consider this..
Contig201#numbPA... (4 Replies)
Input File is :
-------------
25060008,0040,03,
25136437,0030,03,
25069457,0040,02,
80303438,0014,03,1st
80321837,0009,03,1st
80321977,0009,03,1st
80341345,0007,03,1st
84176527,0047,03,1st
84176527,0047,03,
20000735,0018,03,1st
25060008,0040,03,
I am using the following in the script... (5 Replies)
Hello experts,
I am trying to remove all lines in a csv file where the 2nd columns is a duplicate. I am try to use sort with the key parameter
sort -u -k 2,2 File.csv > Output.csv
File.csv
File Name|Document Name|Document Title|Organization
Word Doc 1.doc|Word Document|Sample... (3 Replies)
Hi:
I am trying to create some script that sorts the files in a subdirectory by date and concatenates the thre most recently created files.
SAy,
file1 date1
file2 date2
file3 date3
file4 date4
file5 date5
file6 date6
i only want to concatenate the first three which are the most... (4 Replies)
I have the following requirement.
1. I have to concatenate the 10 fixed width files.
2. sort based on first 10 characters
3. after that i have remove first 10 chacters from the file.
can you please tell me how to do it.
Thanks in Advance
Samba (1 Reply)
Hi,
I'm using the below command to sort and remove duplicates in a file. But, i need to make this applied to the same file instead of directing it to another.
Thanks (6 Replies)
Hi ,
I have below data inside a file named ref.psv . I want to create a shell script which will do the below 2 points :
(1) sort the file content first based on the latest date which is the last column in the file (actual file its the 175th column)
(2)after sorting the file based on latest date... (3 Replies)
I need to use bash to remove duplicates without using sort first.
I can not use:
cat file | sort | uniq
But when I use only
cat file | uniq
some duplicates are not removed. (4 Replies)
Here is my task :
I need to sort two input files and remove duplicates in the output files :
Sort by 13 characters from 97 Ascending
Sort by 1 characters from 96 Ascending
If duplicates are found retain the first value in the file
the input files are variable length, convert... (4 Replies)
I have /tmp dir with filename as:
010020001_S-FOR-Sort-SYEXC_20160229_2212101.marker
010020001_S-FOR-Sort-SYEXC_20160229_2212102.marker
010020001-S-XOR-Sort-SYEXC_20160229_2212104.marker
010020001-S-XOR-Sort-SYEXC_20160229_2212105.marker
010020001_S-ZOR-Sort-SYEXC_20160229_2212106.marker... (4 Replies)
Discussion started by: gnnsprapa
4 Replies
LEARN ABOUT CENTOS
cpan::changes::release
CPAN::Changes::Release(3) User Contributed Perl Documentation CPAN::Changes::Release(3)NAME
CPAN::Changes::Release - Information about a particular release
SYNOPSIS
my $rel = CPAN::Changes::Release->new(
version => '0.01',
date => '2009-07-06',
);
$rel->add_changes(
{ group => 'THINGS THAT MAY BREAK YOUR CODE' },
'Return a Foo object instead of a Bar object in foobar()'
);
DESCRIPTION
A changelog is made up of one or more releases. This object provides access to all of the key data that embodies a release including the
version number, date of release, and all of the changelog information lines. Any number of changelog lines can be grouped together under a
heading.
METHODS
new( %args )
Creates a new release object, using %args as the default data.
version( [ $version ] )
Gets/sets the version number for this release.
date( [ $date ] )
Gets/sets the date for this release.
changes( [ $group ] )
Gets the list of changes for this release as a hashref of group/changes pairs. If a group name is specified, an array ref of changes for
that group is returned. Should that group not exist, undef is returned.
add_changes( [ \%options ], @changes )
Appends a list of changes to the release. Specifying a "group" option appends them to that particular group. NB: the default group is
represented by and empty string.
# Append to default group
$release->add_changes( 'Added foo() function' );
# Append to a particular group
$release->add_changes( { group => 'Fixes' }, 'Fixed foo() function' );
set_changes( [ \%options ], @changes )
Replaces the existing list of changes with the supplied values. Specifying a "group" option will only replace change items in that group.
clear_changes( )
Clears all changes from the release.
groups( sort => &sorting_function )
Returns a list of current groups in this release.
If sort is provided, groups are sorted according to the given function. If not, they are sorted alphabetically.
add_group( @groups )
Creates an empty group under the names provided.
delete_group( @groups )
Deletes the groups of changes specified.
delete_empty_groups( )
Deletes all groups that don't contain any changes.
serialize( group_sort => &sorting_function )
Returns the release data as a string, suitable for inclusion in a Changes file.
If group_sort is provided, change groups are sorted according to the given function. If not, groups are sorted alphabetically.
SEE ALSO
o CPAN::Changes::Spec
o CPAN::Changes
o Test::CPAN::Changes
AUTHOR
Brian Cassidy <bricas@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2011-2013 by Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.16.3 2013-05-02 CPAN::Changes::Release(3)