The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


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 !!


Other UNIX.COM Threads You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Merging lines using AWK senthil_is Shell Programming and Scripting 6 03-05-2008 08:40 AM
Merging lines - Tuning the script senthil_is Shell Programming and Scripting 3 03-04-2008 11:24 PM
Merging files with AWK filtering and counting lines Meert Shell Programming and Scripting 2 01-28-2008 07:58 AM
merging two lines in a file thaduka UNIX for Dummies Questions & Answers 6 07-11-2007 06:27 AM
How to count lines - ignoring blank lines and commented lines kthatch UNIX for Dummies Questions & Answers 6 05-24-2007 10:21 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-18-2005
Registered User
 

Join Date: Jun 2005
Location: Czech rep.
Posts: 7
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Question Merging lines into one

Hello. I would be very pleased if sb. help me to solve my problem. I've got a file with many non blank lines and I want to merge all lines into one not destroy the informations on them. I've tryed it with split and paste, tr, sed , but everything I've done has been wrong. I know about crazy solution but I don't want to do it this way. Don't forget the simplier way is the better. Thaks

Last edited by Foxgard : 06-18-2005 at 03:46 PM.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-18-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 2,960
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
tr -d '\n' < file
Reply With Quote
  #3 (permalink)  
Old 06-18-2005
Registered User
 

Join Date: Jun 2005
Location: Czech rep.
Posts: 7
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Misunderstanding

You don't understand me. I've filled up my problem with red-coloured text to U understand me. Your solution only deletes all the newlines "\n". And that I didn't want to do with the file.
e.g.
from
A
B
C
into
ABC
Reply With Quote
  #4 (permalink)  
Old 06-18-2005
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,312
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
How is that different from deleting the newline characters?
Reply With Quote
  #5 (permalink)  
Old 06-19-2005
Registered User
 

Join Date: Jun 2005
Location: Czech rep.
Posts: 7
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
I see how you want it to work, but it doesn't work. When I send the command to bash, it deletes all the lines from input. I've had some problems with intepretation of the commands even if the command was standard before. I use the xandros 3.01,GNU bash version 2.05b.0(1)-release (i386-pc-linux-gnu). May the problem be in my OS?
Reply With Quote
Google UNIX.COM
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB 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 -7. The time now is 09:31 PM.


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

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102