UNIX sorting - csv file

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications UNIX sorting - csv file
# 1  
Old 08-24-2009
Bug UNIX sorting - csv file

Hi,
Please help me to solve sorting in CSV file.
I have 25 columns in my CSV. (Delimiter is ",")
Summary columns are from 10 to 13 which are should not be sorted. From 1-9 and 14-25 should be able to sort in ascending. how should i do this using Sort command in unix.
If no simple commands pls suggest me, If I can sort only character field columns in the csv would be enough.

Thanks in advance!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Convert CSV file to nested XML file using UNIX/PERL?

we have a CSV which i need to convert to XML using Perl or Unix shell scripting. I was able to build this XML in oracle database. However, SQL/XML query is running for long time. Hence, I'm considering to write a Perl or shell script to generate this XML file. Basically need to build this XML... (3 Replies)
Discussion started by: laknar
3 Replies

2. Shell Programming and Scripting

Sorting a CSV file by DOB

I have absolutaly no idea how to get this script to sort the info in Birthdays.csv by date of birth. I know the sort -n command, however i wish to sort the file birthdays.csv by DOB. How would i go about doing this? The below script gets user info and date of birth and then puts these info a... (3 Replies)
Discussion started by: redshine6
3 Replies

3. Shell Programming and Scripting

Sorting the csv file in Perl

Hi All How all are doing today. Just struck in an issue in Perl I have a csv file which contain 32 column, I want to make sorting in that csv file with respect to 26th column. Is it possible to do so without any module being added? Regards Aditya ---------- Post updated at 10:02 AM... (11 Replies)
Discussion started by: adisky123
11 Replies

4. Shell Programming and Scripting

CSV Sorting on only particular columns

Hello! So ive been presented with this comma-delimited file: I need a print to look as below " lastname, phone_number, zip for every person with a last name starting with the letter H, I only with a 650-area code phone number. output should be sorted by reverse ZIP code " I only have... (5 Replies)
Discussion started by: strangemachine
5 Replies

5. Shell Programming and Scripting

CSV file in unix

Hi I have a problem and was wondering if anyone could help? Anyone can input their full name, email, birth date, gender how can I put this into a comma seperate value file? And then be able to sort it by their gender? Any help is appreicated I'm novice! (1 Reply)
Discussion started by: albertne
1 Replies

6. Shell Programming and Scripting

Sorting a .csv using awk or other

Hello all, I am new here and *relatively* new to Unix. I have a bit of an emergency. I have a three column file that I need to sort: sample name, miRNA, reads per million (RPM) There are multiple samples, and for each sample name there are multiple miRNAs and associated RPMs. Some of these... (6 Replies)
Discussion started by: dunnybocter
6 Replies

7. Shell Programming and Scripting

Need help in writing a routine for sorting a CSV file

Hi, I have a CSV file in following manner: server1,env1,patch1 server1,env1,patch2 server1,env1,patch3 server1,env2,patch1 server1,env2,patch3 server2,env3,patch1 server2,env3,patch5 server2,env4,patch1 server3,env6,patch1 server3,env7,patch2 server3,env7,patch3 I want to... (6 Replies)
Discussion started by: avikaljain
6 Replies

8. Shell Programming and Scripting

sorting csv file based on column selected

Hi all, in my csv file it'll look like this, and of course it may have more columns US to UK;abc-hq-jcl;multimedia UK to CN;def-ny-jkl;standard DE to DM;abc-ab-klm;critical FD to YM;la-yr-tym;standard HY to MC;la-yr-ytm;multimedia GT to KJ;def-ny-jrt;critical I would like to group... (4 Replies)
Discussion started by: tententen
4 Replies

9. UNIX for Advanced & Expert Users

Problem in converting password protected excel file to csv file in unix

I need to convert a password protected excel file which will be in UNIX server to a comma separated file. For this I need to open the excel file in UNIX box but the UNIX box doesn't prompt for password instead it is opened in an encrypted manner. I could manually ftp the excel file to local... (2 Replies)
Discussion started by: Devivish
2 Replies

10. Shell Programming and Scripting

Help sorting .csv file

Hi, I have a .csv file which contains script names, subjects and email_addresses The first two colums are always script name and subject, the next 20 colums are email address.. What i want to do is sort the email address in alphabetical order for each row and there's around 1200 rows. So... (3 Replies)
Discussion started by: Jazmania
3 Replies
Login or Register to Ask a Question
TM::Serializable::CSV(3pm)				User Contributed Perl Documentation				TM::Serializable::CSV(3pm)

NAME
TM::Serializable::CSV - Topic Maps, trait for parsing (and later dumping) CSV stream SYNOPSIS
# 1) bare bones my $tm = .....; # get a map from somewhere (can be empty) Class::Trait->apply ($tm, "TM::Serializable::CSV"); use Perl6::Slurp; $tm->deserialize (slurp 'myugly.csv'); # 2) exploiting the timed sync in/out mechanism my $tm = new TM::.... (url => 'file:myugly.csv'); # get a RESOURCEABLE map from somewhere $tm->sync_in; DESCRIPTION
This trait provides parsing and dumping from CSV formatted text streams. INTERFACE
Methods deserialize $tm->deserialize ($text) This method consumes the text string passed in and interprets it as CSV formatted information. What topic map information is generated, depends on the header line (the first line): o If the header line contains a field called "association-type", then all rows will be interpreted as assertions. In that the remaining header fields (in that order) are interpreted as roles (role types). For all rows in the CSV stream, the position where the "association-type" field was is ignored. The other fields (in that order) are affiliated with the corresponding roles. Example: association-type,location,bio-unit is-born,gold-coast,rumsti is-born,vienna,ramsti Scoping cannot be controlled. Also all players and roles (obviously) are directly interpreted as identifiers. Subject identifiers and locators are not (yet) implemented. o If the header line contains a field called "id", then all further rows will be interpreted as topic characteristics, with each topic on one line. The column position where the "id" field in the header is will be interpreted as toplet identifier. All further columns will be interpreted according to the following: o If the header column is named "name", the values will be used as topic names. o Otherwise if the value looks like a URI, an occurrence with that URI value will be be added to the topic. o Otherwise an occurrence with a string value will be added to the topic. Example: name,id,location,homepage "Rumsti",rumsti,gold-coast,http://rumsti.com "Ramsti",ramsti,vienna,http://ramsti.com serialize $tm->serialize [Since TM 1.53] This method serializes a fragment of a topic map into CSV. Which fragment can be controlled with the header line and options (see constructor). "header_line" (only for serialization) This string contains a comma separated list (CSV parseable) of headings. If one of the headings is "association-type", then the generated CSV content will contain associations only. Nothing else is implemented yet. The other headings control which roles (and in which order) should be included in the CSV content. If a particular role type has more than one player, then all players are included. NOTE: As this is inconsistent, this will have to change. "type" (only for serialization) If existing, then this controls which association type is to be taken. "baseuri" (only for serialization) If existing and non-zero, the base URI of the map will remain in the identifiers. Otherwise it will be removed. "specification" If existing (and when selecting only associations), this specification will be interpreted in the sense of "asserts" (see TM). Example: $tm->serialize (header_line => 'association-type,location,bio-unit', type => 'is-born', baseuri => 0); SEE ALSO
TM, TM::Serializable AUTHOR INFORMATION
Copyright 2010 Robert Barta. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. http://www.perl.com/perl/misc/Artistic.html perl v5.10.1 2012-06-05 TM::Serializable::CSV(3pm)