Sponsored Content
Top Forums Shell Programming and Scripting Sorting a .csv using awk or other Post 302514962 by dunnybocter on Monday 18th of April 2011 03:03:56 PM
Old 04-18-2011
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 miRNAs overlap between samples, but not all, so here is what the input file looks like

Sample 1, mirna1,RPM
Sample 1, mirna3,RPM
Sample 1, mirna4, RPM
Sample 2, mirna2,RPM
Sample2, mirna3, RPM
Sample2, mirna4, RPM

I need an output file that looks like this
miRNA1 miRNA2 .... miRNAx
Sample 1 RPM RPM
Sample 2 RPM RPM
Sample 3 RPM RPM
etc


Basically, each row should be a sample and each column should have the RPM corresponding the the miRNA for that sample. I also need to put a zero if there is no value for an miRNA in a specific sample. The output should be csv as well.

Any ideas or help would be greatly appreciated. I am trying to use awk but I'm lost and very much in a rush. MOST SINCERE THANKS IN ADVANCE!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk sorting

Hi, I have used the following code to sort two sets of data: awk '{printf "%10s %s\n",$1,$2}' The first column is text and the second involves numbers. I was just wondering how i would go about sorting the second number so that they ascend from the top? Thanks for any help (4 Replies)
Discussion started by: Jaken
4 Replies

2. 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

3. 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

4. UNIX and Linux Applications

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... (0 Replies)
Discussion started by: rajani_p
0 Replies

5. 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

6. Shell Programming and Scripting

CSV to SQL insert: Awk for strings with multiple lines in csv

Hi Fellows, I have been struggling to fix an issue in csv records to compose sql statements and have been really losing sleep over it. Here is the problem: I have csv files in the following pipe-delimited format: Column1|Column2|Column3|Column4|NEWLINE Address Type|some descriptive... (4 Replies)
Discussion started by: khayal
4 Replies

7. Shell Programming and Scripting

awk read column csv and search in other csv

hi, someone to know how can i read a specific column of csv file and search the value in other csv columns if exist the value in the second csv copy entire row with all field in a new csv file. i suppose that its possible using awk but i m not expertise thanks in advance (8 Replies)
Discussion started by: giankan
8 Replies

8. 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

9. 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

10. 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
FINSIO(4)						   BSD Kernel Interfaces Manual 						 FINSIO(4)

NAME
finsio -- Fintek LPC Super I/O driver SYNOPSIS
finsio0 at isa? port 0x4e DESCRIPTION
The finsio driver provides support for the Fintek F71805F, F71806F, F71862FG, F71872, F71882 and F71883 LPC Super I/O chips. Only the Hardware Monitor device is supported and it provides you to monitor the sensors through the envsys(4) API. The finsio Super I/O Hardware Monitor supports 15 sensors (this depends on the chip ID): Sensor Units Typical Use IN0 uV DC Internal 3.3Vcc IN1 uV DC Memory Vtt IN2 uV DC RAM Vcc IN3 uV DC Chipset V IN4 uV DC +5V IN5 uV DC +12V IN6 uV DC Vcc 1.5V IN7 uV DC Vcore IN8 uV DC Vsb IN9 uV DC Vbat (optional) Temp1 uK CPU Temperature Temp2 uK Motherboard Temperature Temp3 uK (undefined) Fan0 RPM CPU Fan Fan1 RPM User Fan1 Fan2 RPM User Fan2 SEE ALSO
envsys(4), envstat(8) HISTORY
The finsio driver first appeared in NetBSD 5.0. AUTHORS
The finsio driver was written by Geoff Steckel and Juan Romero Pardines. BSD
April 3, 2008 BSD
All times are GMT -4. The time now is 10:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy