Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Join lines that match an string

by ambrus (Abbot)
on Jul 13, 2010 at 09:51 UTC ( [id://849217]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    echo -e 'g/\<remotely\>/.,/\<p_args\>/j\nwq' | ed -sl filename
    
  2. or download this
    $ cat a
    "Yes, and to be grown up,
    ...
    "That indeed he is."
    
    $
    
  3. or download this
    for t in 's/$/ /' j; do echo -e 'g/\<remotely\>/.,/\<p_args\>/'"$t"'\n
    +wq' | ed -sl filename
    
  4. or download this
    g='g/\<remotely\>/.,/\<p_args\>/'; echo -e "${g}s/\$/ /\n${g}j\nwq" | 
    +ed -sl filename
    
  5. or download this
    ex -c $'g/\<remotely\>/.,/\<p_args\>/j\nwq' filename
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://849217]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-24 05:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found