Solved

sed - join lines

Posted on 1997-03-06
1
1,631 Views
Last Modified: 2013-12-16
with cshell, how can I use sed to join two consecutive lines?
0
Comment
Question by:funcell
1 Comment
 
LVL 4

Accepted Solution

by:
jos010697 earned 50 total points
ID: 1811810
Use this as a sed script:

:join
/$/{N
s/\n//
}

It read two consecutive lines and joins them; the cycle
is repeated over and over again for the entire file. So,
if the gibberish above is saved in, say, script.sed,
the command

sed -f script.sed "filename"

joins all consecutive lines from that file.

kind regards,

Jos aka jos@and.nl
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now