The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Find/replace to new file: ksh -> perl McLan Shell Programming and Scripting 1 05-16-2008 12:14 AM
Find and Replace NycUnxer UNIX for Dummies Questions & Answers 4 03-05-2008 08:20 PM
find and replace pattren in file gopalss Shell Programming and Scripting 5 08-09-2007 12:06 AM
find and replace mahabunta UNIX for Dummies Questions & Answers 7 09-21-2006 09:05 AM
find and replace a pattern in a file krishnamaraju Shell Programming and Scripting 1 08-29-2006 07:02 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-14-2005
Registered User
 

Join Date: Feb 2005
Posts: 26
Find replace within a file?

I build several files by using the cut command to grab select fields(columns) from a really bid csv file. Each file is one column of data. I then put them together using paste command. Here is the code built in tcsh:

cut -d , -f 1 some.csv > 1.csv
cut -d , -f 10 some.csv > 10.csv
paste 1.csv 10.csv > combined
rm 1.csv
rm 10.csv

Here is my Q? This leaves me with a data file, "combined" that is tab delimited (about 6 fields, no header row). I want it to be be a csv, how can i find/replace tab-stops with commas within the file?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-14-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 2,999
paste -d ',' 1.csv 10.csv > combined
Reply With Quote
  #3 (permalink)  
Old 06-15-2005
Registered User
 

Join Date: Feb 2005
Posts: 26
Thanks vgersh99! That's perfect!
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:35 AM.


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

Content Relevant URLs by vBSEO 3.2.0