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
Delete Duplicate records from a tilde delimited file irshadm Shell Programming and Scripting 5 12-06-2007 05:36 AM
how to extract a tilde delimited file in unix trichyselva Shell Programming and Scripting 12 03-06-2007 12:19 AM
How do I insert commas/delimiters in File mbelen UNIX for Dummies Questions & Answers 4 05-19-2005 07:10 PM
tab delimited file to commas hcclnoodles Shell Programming and Scripting 6 08-16-2004 02:23 PM
removing commas from text file hcclnoodles UNIX for Dummies Questions & Answers 6 03-26-2003 04:43 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 11-13-2006
femig femig is offline
Registered User
  
 

Join Date: May 2006
Posts: 1
replacing commas with tilde in csv file.

hello all,
i have a comma delimited file.
i want to replace the commas in the file with the tilde symbol using sed.
how can i do this?
thanks.
  #2 (permalink)  
Old 11-13-2006
aigles's Avatar
aigles aigles is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,433

Code:
sed 's/,/~/g' input_file > temp_file && mv temp_file input_file

or using perl:

Code:
perl -p -i -e 's/,/~/g' input_file


jean-Pierre.
  #3 (permalink)  
Old 11-13-2006
009satya
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
sed -e 's/,/~/g' filename
  #4 (permalink)  
Old 11-13-2006
justsam
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
sed 's/,/~/g' filename > newfile
  #5 (permalink)  
Old 11-13-2006
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
.... unless you have embedded commas.
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:03 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