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
Range specification in for loop Niyati Shell Programming and Scripting 2 09-20-2007 02:47 AM
hw can i count the number of character in a file by perl trupti_rinku Shell Programming and Scripting 1 10-31-2006 07:27 AM
defining a variable as a number or character? noobian UNIX for Dummies Questions & Answers 1 04-26-2005 09:19 PM
Number or Character j1yant Shell Programming and Scripting 3 02-10-2003 02:08 AM
HD specification abolshoun UNIX for Dummies Questions & Answers 2 08-13-2001 11:49 AM

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 05-08-2006
mvalonso mvalonso is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 17
Sed character number specification

I have the following sed command:

sed '/7361105/s/^\(................................................................................................. .............................................................................\)....\(.*\)/\16776\2/' arch.txt > arch.tmp && mv arch.tmp arch.txt

and I would like to replace the n "." (174 characters) in the first expression, to an expression that does the same (indicate that I want to replace from character number 175).
I've checked it out in manuals and tutorials but I can't seem to make it work.
Any ideas?
  #2 (permalink)  
Old 05-08-2006
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,122
Code:
echo 'qwerty' | sed 's/^\(.\{2\}\)..\(..\)/\112345\2/g'
  #3 (permalink)  
Old 05-09-2006
ranj@chn ranj@chn is offline Forum Advisor  
Playing with Ubuntu Now!
  
 

Join Date: Oct 2005
Location: Chennai
Posts: 365
is this correct

Does the '2' in the pattern mean the no of characters to make the pattern?
  #4 (permalink)  
Old 05-09-2006
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,122
Quote:
Originally Posted by ranj@chn
Does the '2' in the pattern mean the no of characters to make the pattern?
that's correct.
  #5 (permalink)  
Old 05-10-2006
mvalonso mvalonso is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 17
Thank you very much for your help!!! I could make it work just perfect!!!!!
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 04:41 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