By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,813 Members | 2,269 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,813 IT Pros & Developers. It's quick & easy.

How to make HTML contnent with same tag in each line using Sed

P: 55
I am looking in a an HTML file to modify for the purpose of easy parsing . I need to put each item of HTML after body to separate line.

eg : my current HTML file is

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  4.   <head>
  5.     <meta content="text/html; charset=utf-8" http-equiv="Content-type" />
  6.     <meta name="ncc:files" content="78" />
  7.   </head>
  8.   <body>
  9.     <h1 class="title" id="h1"><a href="001.smil#txt4">ABOUT DAISY</a></h1>
  10.     <h1 class="section" id="h7">
  11.       <a href="002.smil#txt10">Cover</a>
  12.     </h1>
  13.     <span class="page-normal" id="p13">
  14.       <a href="002.smil#txt15">1</a>
  15.     </span>
  16.     <h1 class="section" id="h18">
  17.       <a href="003.smil#txt21">Swadesaabhimaani, K. Kelappan, Muhammad Abdul Rahiman</a>
  18.     </h1>
  19.     <span class="page-normal" id="p24">
  20.       <a href="003.smil#txt26">2</a>
  21.     </span>
  22.     <span class="page-normal" id="p33">
  23.       <a href="003.smil#txt35">3</a>
  24.     </span>
  25.     <h1 class="section" id="h38">
  26.       <a href="004.smil#txt41">Title</a>
  27.     </h1>
  28.     <span class="page-normal" id="p45">
  29.       <a href="004.smil#txt47">4</a>
  30.     </span>
  31.     <h1 class="section" id="h50">
  32.       <a href="005.smil#txt53">Publication</a>
  33.     </h1>
  34.     <span class="page-normal" id="p69">
  35.       <a href="005.smil#txt71">5</a>
  36.     </span>
  37.     <h1 class="section" id="h74">
  38.       <a href="006.smil#txt77">K. Ramakrishnapilla</a>
  39.     </h1>
  40.       </body>
  41. </html>
  42.  

required html must be same line without line split after <body> tag .

means each tag content must come in same line without split. Please advise How it can do with Sed...

Waiting fast reply...

Thanks

Anes
Jan 19 '16 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.