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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Adding words to beginning of lines Ernst Shell Programming and Scripting 9 04-03-2008 11:23 AM
Need to serach if a new line character exists on the last line in a file sunilbm78 UNIX for Dummies Questions & Answers 10 02-29-2008 11:15 AM
adding a line to a file andy2000 Shell Programming and Scripting 2 03-26-2007 05:44 AM
input a line at the beginning of every file in a directory? Terrible Shell Programming and Scripting 6 08-16-2006 03:42 AM
Unix Script with line number at beginning of each line. mascorro Shell Programming and Scripting 5 06-19-2006 01:34 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-22-2005
Registered User
 

Join Date: Dec 2005
Posts: 1
Lightbulb Adding a character in the beginning of every line in a .dat file

How can i add a character(#) in the beginning of every line in a .dat file
Reply With Quote
Forum Sponsor
  #2  
Old 12-22-2005
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,699
Code:
sed -i -e 's_.*_#&_' input.dat
Reply With Quote
  #3  
Old 12-22-2005
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
one more,

Code:
awk '{ printf "#"; print }' <filename>
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:44 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0