The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
replace > with new line character borncrazy Shell Programming and Scripting 4 07-15-2008 02:34 AM
Replace certain character with a new a new line. djsal Shell Programming and Scripting 8 01-11-2008 12:59 PM
to replace a new line character chan Shell Programming and Scripting 2 01-11-2008 12:56 PM
Replace a character in last line Mohammed Shell Programming and Scripting 6 08-01-2007 03:46 PM
How would I replace the 9th character of every line in a file? LordJezo Shell Programming and Scripting 5 09-01-2004 12:51 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 02-09-2009
Raju Datla Raju Datla is offline VIP Member  
Supporter
  
 

Join Date: Dec 2008
Posts: 3
how to replace character in the line

I have unix text file which has the following data

aadjdfad;fa;fjjd;lakd;lkaslkd;k;k;lk;k;lk;l;lk;lkj;lj;lkj;k;lkj;lj;lkj;lkj;lkj;j
sdkadk;adlf;lajf;akdjf;lkdjf;lkadjf;lkajsd;lfkj;lkj;lkj;lk;lk;lk;lk;k;lkj;k;lkm
lkj;lkj;lkj;lkj;lj;lkj;lkj;ljlj;lkj;lkj;ljl;j;lj;lkj;lkj;lkj;ljsdfa;ldf;lj;lkj;lkj;lkasdks

I want to replace every 13th semicolon ; with any text ex. 'raju' in everyline, how it is possible.
  #2 (permalink)  
Old 02-09-2009
pmm pmm is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 50
Assuming you mean replace 13th occurrence in each line:

Code:
 sed 's/;/raju/13' infile > outfile
  #3 (permalink)  
Old 02-11-2009
Raju Datla Raju Datla is offline VIP Member  
Supporter
  
 

Join Date: Dec 2008
Posts: 3
thank you , it works exactly .
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 11:50 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