Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

sed - join lines

Posted on 1997-03-06
1
1,653 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

828 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