Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to convert the HTML lines to variables

Status
Not open for further replies.
Jan 24, 2002
5
0
0
ES
Hi!

I'm trying to add to each line in the html doc a dinamic string at the begining and an static string at the end like this

ORIGINAL
<html>
<head>
<title>Preview</title>

EDITED
h1=&quot;<html>&quot;
h2=&quot;<head>&quot;
h3=&quot;<title>Preview</title>&quot;

If somebody could help me?

Thanks
 
Try this.
Code:
/^<.*>$/ {print &quot;h&quot; ++i &quot;=&quot; &quot;\042&quot; $0 &quot;\042&quot;}
Hope this helps.
CaKiwi
 
Hi CaKiwi:

Has been imposible to me to run the command. I don`t know why doesn't work i wrote this.

gawk /^<.*>$/ {print &quot;h&quot; ++i &quot;=&quot; &quot;\042&quot; $0 &quot;\042&quot;} tom //tom is the file i want to edit

AND

gawk tom //tom has the parameters

I cannot make it work

Would anybody help me?

Thanks
Tomix

 

gawk '/^<.*>$/ {print &quot;h&quot; ++i &quot;=&quot; &quot;\042&quot; $0 &quot;\042&quot;}' tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top