Sorting and saving values based on unique entries


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Sorting and saving values based on unique entries
Prev   Next
# 5  
Old 01-08-2014
Thank you very much for the quick reply. I will give it a try and will get back to you.Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Print lines based upon unique values in Nth field

For some reason I am having difficulty performing what should be a fairly easy task. I would like to print lines of a file that have a unique value in the first field. For example, I have a large data-set with the following excerpt: PS003,001 MZMWR/ L-DWD// * PS003,001... (4 Replies)
Discussion started by: jvoot
4 Replies

2. Shell Programming and Scripting

Sorting unique by column

I am trying to sort, do uniq by 1st column and report this 4 columns tab delimiter table , eg chr10:112174128 rs2255141 2E-10 Cholesterol, total chr10:112174128 rs2255141 7E-16 LDL chr10:17218291 rs10904908 3E-11 HDL Cholesterol chr10:17218291 rs970548 8E-9 TG... (4 Replies)
Discussion started by: fat
4 Replies

3. Shell Programming and Scripting

Sorting out unique values from output of for loop.

Hi , i have a belwo script which is used to get sectors per track value extarcted from Solaris machine: for DISK in /dev/dsk/c*t*d*s*; do value=`prtvtoc "$DISK" | sed -n -e '/Dimensions/,/Flags/{/Dimensions/d; /Flags/d; p; }' | sed -n -e '/sectors\/track/p'`; if ; then echo... (4 Replies)
Discussion started by: omkar.jadhav
4 Replies

4. Linux

To get all the columns in a CSV file based on unique values of particular column

cat sample.csv ID,Name,no 1,AAA,1 2,BBB,1 3,AAA,1 4,BBB,1 cut -d',' -f2 sample.csv | sort | uniq this gives only the 2nd column values Name AAA BBB How to I get all the columns of CSV along with this? (1 Reply)
Discussion started by: sanvel
1 Replies

5. Shell Programming and Scripting

Unique entries based on a range of numbers.

Hi, I have a matrix like this: Algorithm predicted_gene start_point end_point A x 65 85 B x 70 80 C x 75 85 D x 10 20 B y 125 130 C y 120 140 D y 200 210 Here there are four tab-separated columns. The first column is the used algorithm for prediction, and there are 4 of them A-D.... (8 Replies)
Discussion started by: flyfisherman
8 Replies

6. Shell Programming and Scripting

Find and count unique date values in a file based on position

Hello, I need some sort of way to extract every date contained in a file, and count how many of those dates there are. Here are the specifics: The date format I'm looking for is mm/dd/yyyy I only need to look after line 45 in the file (that's where the data begins) The columns of... (2 Replies)
Discussion started by: ronan1219
2 Replies

7. UNIX for Dummies Questions & Answers

Assistance with combining, sorting and saving multi files into one new file

Good morning. I have a piece of code that is currently taking multiple files and using the CAT.exe command to combine into one file that is then sorted in reverse order based on the 3rd field of the file, then displayed on screen. I am trying to change this so that the files are being combined into... (4 Replies)
Discussion started by: jaacmmason
4 Replies

8. Shell Programming and Scripting

Finding unique entries without sorting

Hi Guys, I have two files that I am using: File1 is as follows: wwe khfgv jfo jhgfd hoaha hao lkahe This is like a master file which has entries in the order which I want. (4 Replies)
Discussion started by: npatwardhan
4 Replies

9. UNIX for Dummies Questions & Answers

need help sorting/deleting non-unique things

I don't really know much about UNIX commands, so if someone could help me understand how to do this, I'd really appreciate it. I have a text file with data that looks like this (filename: numbers.txt): 1 1 1 1 1 1 1 1 1 2 1 1_2 2_1 1 1 1 1 1 1 1 1 2 1 2 1_2 2_1 1 1 1 1 1 1 1 1 2 1 2 1_2 2_1... (12 Replies)
Discussion started by: zac100
12 Replies

10. Shell Programming and Scripting

sorting file and unique commnad..

hello everyone.. I was wondering is there a effective way to sort file that contains colomns and numeric one. file 218900012192 8938929 8B8DF3664 1E7E2D59D5 0000 26538 1234 74024415 218900012979 8938929 8B8DF3664 1E7E2D59D5 0000 26538 1234 74024415 218900012992 8938929 8B8DF3664... (2 Replies)
Discussion started by: amon
2 Replies
Login or Register to Ask a Question
DBSchema::DBD(3pm)					User Contributed Perl Documentation					DBSchema::DBD(3pm)

NAME
DBIx::DBSchema::DBD - DBIx::DBSchema Driver Writer's Guide and Base Class SYNOPSIS
perldoc DBIx::DBSchema::DBD package DBIx::DBSchema::DBD::FooBase use DBIx::DBSchema::DBD; @ISA = qw(DBIx::DBSchema::DBD); DESCRIPTION
Drivers should be named DBIx::DBSchema::DBD::DatabaseName, where DatabaseName is the same as the DBD:: driver for this database. Drivers should implement the following class methods: columns CLASS DBI_DBH TABLE Given an active DBI database handle, return a listref of listrefs (see perllol), each containing six elements: column name, column type, nullability, column length, column default, and a field reserved for driver-specific use. column CLASS DBI_DBH TABLE COLUMN Same as columns above, except return the listref for a single column. You can inherit from DBIx::DBSchema::DBD to provide this function. primary_key CLASS DBI_DBH TABLE Given an active DBI database handle, return the primary key for the specified table. unique CLASS DBI_DBH TABLE Deprecated method - see the indices method for new drivers. Given an active DBI database handle, return a hashref of unique indices. The keys of the hashref are index names, and the values are arrayrefs which point a list of column names for each. See "HASHES OF LISTS" in perldsc and DBIx::DBSchema::Index. index CLASS DBI_DBH TABLE Deprecated method - see the indices method for new drivers. Given an active DBI database handle, return a hashref of (non-unique) indices. The keys of the hashref are index names, and the values are arrayrefs which point a list of column names for each. See "HASHES OF LISTS" in perldsc and DBIx::DBSchema::Index. indices CLASS DBI_DBH TABLE Given an active DBI database handle, return a hashref of all indices, both unique and non-unique. The keys of the hashref are index names, and the values are again hashrefs with the following keys: name - Index name (redundant) using - Optional index method unique - Boolean indicating whether or not this is a unique index columns - List reference of column names (or expressions) (See FS::DBIx::DBSchema::Index) New drivers are advised to implement this method, and existing drivers are advised to (eventually) provide this method instead of index and unique. For backwards-compatibility with current drivers, the base DBIx::DBSchema::DBD class provides an indices method which uses the old index and unique methods to provide this data. default_db_catalog Returns the default database catalog for the DBI table_info command. Inheriting from DBIx::DBSchema::DBD will provide the default empty string. default_db_schema Returns the default database schema for the DBI table_info command. Inheriting from DBIx::DBSchema::DBD will provide the default empty string. column_callback DBH TABLE_NAME COLUMN_OBJ Optional callback for driver-specific overrides to SQL column definitions. Should return a hash reference, empty for no action, or with one or more of the following keys defined: effective_type - Optional type override used during column creation. explicit_null - Set true to have the column definition declare NULL columns explicitly effective_default - Optional default override used during column creation. effective_local - Optional local override used during column creation. add_column_callback DBH TABLE_NAME COLUMN_OBJ Optional callback for additional SQL statments to be called when adding columns to an existing table. Should return a hash reference, empty for no action, or with one or more of the following keys defined: effective_type - Optional type override used during column creation. effective_null - Optional nullability override used during column creation. sql_after - Array reference of SQL statements to be executed after the column is added. alter_column_callback DBH TABLE_NAME OLD_COLUMN_OBJ NEW_COLUMN_OBJ Optional callback for overriding the SQL statments to be called when altering columns to an existing table. Should return a hash reference, empty for no action, or with one or more of the following keys defined: sql_alter - Alter SQL statement(s) for changing everything about a column. Specifying this overrides processing of individual changes (type, nullability, default, etc.). sql_alter_type - Alter SQL statement(s) for changing type and length (there is no default). sql_alter_null - Alter SQL statement(s) for changing nullability to be used instead of the default. column_value_needs_quoting COLUMN_OBJ Optional callback for determining if a column's default value require quoting. Returns true if it does, false otherwise. TYPE MAPPING
You can define a %typemap array for your driver to map "standard" data types to database-specific types. For example, the MySQL TIMESTAMP field has non-standard auto-updating semantics; the MySQL DATETIME type is what other databases and the ODBC standard call TIMESTAMP, so one of the entries in the MySQL %typemap is: 'TIMESTAMP' => 'DATETIME', Another example is the Pg %typemap which maps the standard types BLOB and LONG VARBINARY to the Pg-specific BYTEA: 'BLOB' => 'BYTEA', 'LONG VARBINARY' => 'BYTEA', Make sure you use all uppercase-keys. AUTHOR
Ivan Kohler <ivan-dbix-dbschema@420.am> COPYRIGHT
Copyright (c) 2000-2005 Ivan Kohler Copyright (c) 2007-2010 Freeside Internet Services, Inc. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. BUGS
SEE ALSO
DBIx::DBSchema, DBIx::DBSchema::DBD::mysql, DBIx::DBSchema::DBD::Pg, DBIx::DBSchema::Index, DBI, DBI::DBD, perllol, "HASHES OF LISTS" in perldsc perl v5.14.2 2010-01-09 DBSchema::DBD(3pm)