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
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 02:15 PM
delete a line based on first character of the line borncrazy UNIX for Dummies Questions & Answers 2 12-06-2005 03:27 PM
stripping last character from end of each line hcclnoodles UNIX for Dummies Questions & Answers 6 11-21-2005 08:35 PM
end of the line character zomboo Shell Programming and Scripting 5 12-30-2004 05:30 PM
Line-drawing character! zecoj High Level Programming 5 03-10-2002 11:38 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 11-21-2007
ravi.sadani19 ravi.sadani19 is offline
Registered User
  
 

Join Date: Jul 2005
Posts: 42
how to add new line character

Hello All,

I want to add new line character to each of the line '\n'.what is the unix command i can use to do that.File is like below

a|b|c
c|d|f
  #2 (permalink)  
Old 11-21-2007
sunsri01 sunsri01 is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 11
Try the following.

cat filename | sed 's/$/\\n/g' > newfilename
  #3 (permalink)  
Old 11-21-2007
prowla prowla is offline
Read Only
  
 

Join Date: Nov 2007
Posts: 165
Many systems have a ux2dos (or unix2dos) command.
  #4 (permalink)  
Old 11-23-2007
varungupta varungupta is offline
Registered User
  
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 206
Thumbs up

Hey,

You can use the following three commands to add a new line to a file.

echo "\n" >> file.outor

echo -e "\n" >> file.out

echo >> yourfile

Thanks
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 08:59 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