Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

sed on a multiline block: strip spaces and newlines within tags
I have a command that spews descriptive output that has attributes (CWD,
TIME, NAME) etc followed by the value enclosed in <>

Unfortunately the original designer thought it to be "smart" [sic.] to
implement his own "word-wrap" at a certain number of columns.
Consequently many of my lines are split at strange locations. He also
inserted spaces to make the output "pretty" by aligning columns.

This makes it awfully inconvenient to process system paths etc. because
of the intervening space and newlines.

Example:
rrrr rrr
cruft cruft
blah blah CWD </xxx/yyy/fff
/zzz/eee/rrr
/ttt/aaa/qqq>

I need a
rrr rrr
cruft cruft
blah blah CWD </xxx/yyy/fff/zzz/eee/rrr/ttt/aaa/qqq>




How do I sed this so that any space-characters and newlines are stripped
BUT only if within a <>? I'm stumped at how to write a sed one liner that
will handle this multi-line pattern space! Any ideas?

--
Rahul

Report this thread to moderator Post Follow-up to this message
Old Post
Rahul
04-03-08 12:41 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Shell Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 02:17 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.