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
How to merge rows into columns ???? bogu0001 Shell Programming and Scripting 4 01-16-2009 07:57 PM
convert rows into columns loperam Shell Programming and Scripting 2 12-01-2008 03:57 AM
how to convert columns to rows suresh3566 Shell Programming and Scripting 6 11-04-2008 08:20 AM
How to changes rows to columns in a file oracle123 Shell Programming and Scripting 4 07-31-2008 05:38 AM
Columns to rows mgirinath Shell Programming and Scripting 16 11-29-2007 07:03 PM

Closed Thread
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
  #1 (permalink)  
Old 04-01-2009
dprakash dprakash is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 4
Pivoting Dynamic rows into columns

Original file we are getting .......
Item Period Amt
P1 106 1000
P1 206 1500
P1 106 2000
P2 256 5800
P2 650 7500
My output should be like this
Item 106 206 256 650 ............
P1 1000 1500 0 0 ............
P1 2000 0 0 0 ...........
P2 0 0 5800 7500 ...............
...........
...........
................
Hi all
my requirement is quite tricky . ..its very urgent...
i want to convert 1st file into as 2nd file........
i want to convert Period col values into columns and amount should be placed w.r.t Period value
If corresponding amount is not available for Period then 0 should be enter for that period...
and Items can be dynamically change.... means it can come P3,P4 etc.......
Thanks
Prakash
  #2 (permalink)  
Old 04-02-2009
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,411
Tricky. Looks like you need a 3D array. What have you tried?
Closed Thread

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 07:51 AM.


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