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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
replace the column values. charandevu Shell Programming and Scripting 6 04-01-2008 11:21 PM
how to read the column and print the values under that column gemini106 Shell Programming and Scripting 6 03-28-2008 03:05 AM
How to check Null values in a file column by column if columns are Not NULLs Mandab Shell Programming and Scripting 7 03-15-2008 05:57 AM
Replace string in column mohan705 UNIX for Advanced & Expert Users 1 09-17-2007 06:38 PM
replace a column values with the first value in column sumeet UNIX for Advanced & Expert Users 3 02-06-2007 09:13 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-05-2005
Registered User
 

Join Date: Aug 2005
Location: Bangalore
Posts: 196
Replace 10th column with a new column--- Terriblly hurry

Hi Can any one tell me how to replace the 10th column in a file(comma delimted) with a new file with a single column. Can any one Help me out of the please as soon as possible as i am in a terribley hurry!!!!!!

Many THanks,
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-05-2005
RishiPahuja's Avatar
Registered User
 

Join Date: Apr 2005
Location: Bangalore, India
Posts: 203
Thumbs up

Suppose your existing file has n columns then using "paste" command make it n+1. this is the new column you want in file.
Next with help of awk reformat the columns as you desire.

something:

Code:
paste file1 file2 > file3   //pls see the manual of paste i m not too sure of the syntax.
awk -F"," 'print $1","$2....$n+1...$n' etc
Reply With Quote
  #3 (permalink)  
Old 09-05-2005
Registered User
 

Join Date: Aug 2005
Location: Bangalore
Posts: 196
Thanks a ton Rishi for your quick swift solution- Cheero !!!!
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:58 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0