LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-30-2006, 08:51 PM   #1
krock923
Member
 
Registered: Jul 2004
Posts: 171

Rep: Reputation: 30
sed question


Hi there. I need to append a string to the beginning of each line in a file. It doesn't have to be using sed, but so far I've had no luck with sed for this. The worst part of all of this is that i'm using so many grep, sed and cut statements that this thing is screaming at me to learn awk. Just don't have time for that at the moment.

Thanks,
Matt
 
Old 04-30-2006, 09:29 PM   #2
ataraxia
Member
 
Registered: Apr 2006
Location: Pittsburgh
Distribution: Debian Sid AMD64
Posts: 296

Rep: Reputation: 30
Substitute "^" with whatever string you need:
Code:
sed -e 's/^/some string/'
 
Old 04-30-2006, 09:36 PM   #3
krock923
Member
 
Registered: Jul 2004
Posts: 171

Original Poster
Rep: Reputation: 30
Thank you. I saw that in the sed one liner page, but i was putting an extra space after /^
 
  


Reply

Tags
sed


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Another SED question 3saul Linux - Software 2 01-28-2007 12:06 PM
[sed] "Advanced" sed question(s) G00fy Programming 2 03-20-2006 12:34 AM
sed question lazyuser Programming 4 02-11-2005 06:11 AM
sed question sphynx Programming 6 04-28-2004 06:25 PM
sed question zoomzoom Linux - Software 2 10-20-2003 04:04 PM


All times are GMT -5. The time now is 07:20 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration