The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Counting number of columns in a delimited file net Shell Programming and Scripting 4 03-05-2009 04:56 AM
Adding EMPTY columns to Tab-delimited txt file Banni UNIX for Dummies Questions & Answers 8 02-28-2009 02:30 PM
Reading columns in tab delimited file net Shell Programming and Scripting 2 02-18-2009 08:01 AM
convert rows into columns loperam Shell Programming and Scripting 2 12-01-2008 03:57 AM
Columns to rows mgirinath Shell Programming and Scripting 16 11-29-2007 07:03 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 06-11-2009
kylle345 kylle345 is offline
Registered User
  
 

Join Date: May 2009
Posts: 53
So I converted columns to rows but I want it to be tab delimited and also I want.....

Hi,

So my file looks like this:

title number
JR 2
JR 2
JR 4
JR 5
NM 5
NM 8
NM 2
NM 8

I used this line that I wrote to convert it to rows so it will look like this:
awk -F"\t" '!/^$/{a[$1]=a[$1]" "$3} END {for ( i in a) {print i,a[i]}}' occ_output.tab > test.txt

JR 2 2 4 5
NM 5 8 2 8

The problem is that the spacing is not tab delimited. I am missing something really obvious...

The next thing I want to do is bin the rows... lets say I wanted to bin every second value and average them.

so it will look like this:

JR 2 4.5
NM 6.5 5

Anyone know a quick liner on how to do that?

thanks
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:10 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0