![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 !! |
More UNIX and Linux Forum Topics 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 12:40 PM |
| Merging lines - Tuning the script | senthil_is | Shell Programming and Scripting | 3 | 03-05-2008 03:24 AM |
| Merging files with AWK filtering and counting lines | Meert | Shell Programming and Scripting | 2 | 01-28-2008 11:58 AM |
| merging two lines in a file | thaduka | UNIX for Dummies Questions & Answers | 6 | 07-11-2007 09:27 AM |
| How to count lines - ignoring blank lines and commented lines | kthatch | UNIX for Dummies Questions & Answers | 6 | 05-25-2007 01:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 06:46 PM.. |
|
||||
|
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 ![]() |
|
||||
|
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?
|
|
||||
|
Code:
bash:cat /tmp/test$$ -prints this #define hcv 54 #define f 8 #define s 354 jae feh h f*h adssfh Code:
bash:sed "/#define.*/w /tmp/test$$" test ; sed '{s_[/t ]*#define[\t ]\+\(\<.\+\>\)[\t ]\+\(\<.\+\>\)_\{s/\1/\2/\};_}' /tmp/test$$ > /tmp/test2$$ ; cat /tmp/test2$$ | tr -d '\n' > file$$; cat file$$ -prints nothing
bash:cat /tmp/test2$$ - prints that should print
{s/hcv/54/};
{s/f/8/};
{s/s/354/};
*mistake by rewriting the code to here, because I read in my code the name of the file from $prom, now it is right Last edited by Foxgard; 06-19-2005 at 07:34 AM.. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| linux, linux commands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|