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
Displaying specific lines in a file. MaestroRage UNIX for Dummies Questions & Answers 3 02-05-2008 04:57 PM
remove specific lines from a file hcclnoodles Shell Programming and Scripting 14 09-07-2006 12:31 PM
How do you specific lines in a file? hedgehog001 UNIX for Dummies Questions & Answers 2 08-23-2005 12:04 AM
Deleting specific lines in a file ramu_1980 Shell Programming and Scripting 4 02-15-2005 01:41 PM
extract specific lines from file apalex UNIX for Dummies Questions & Answers 2 05-15-2001 09:57 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-15-2005
aukequist aukequist is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 5
Update specific lines in a file

Hi all,
I want to add a special character ^M to a line, if the line starts with ORDE.
All the other lines should remain unchanged.
Is there sed or other UNIX function who can do this.

Thanx in advance
Auke Quist
  #2 (permalink)  
Old 11-15-2005
Corrail Corrail is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 50
Question

not really sure how to use grep but maybe grep for the line with ORDE in it. there is something in man sed that might help its something like [2addr]H Append a newline character followed by the contents of the pattern space to hold the space. I think that could help you maybe? idk just trying to learn by giving suggestions, doing a little research, and seeing if they work
  #3 (permalink)  
Old 11-15-2005
aukequist aukequist is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 5
This helps a bit, any other suggestions still welcome
  #4 (permalink)  
Old 11-15-2005
futurelet futurelet is offline
Registered User
  
 

Join Date: Jul 2005
Posts: 137
Awk:
Code:
/ORDE/ { $0 = $0 "\r" }
{ print }
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:57 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