html - How to add lines using command line -
I have an HTML document in which I want to insert an image automatically after the body tag immediately:
Html:
& lt; Body & gt; & Lt; Div class = "indexHeader" & gt; & Lt; A href = "allclasses-frame.html" target = "package-frames" & gt; All classes & lt; / A & gt; & Lt; / Div & gt; ....
and simply & lt; Body & gt; After the
tag I want to use the command lines to an image, and the result will be:
& Lt; Div class = "indexHeader" & gt; & Lt; A href = "allclasses-frame.html" target = "packageframe" & gt; All classes & lt; / A & gt; & Lt; / Div & gt;
How can I get it in command lines? Note: I'm using Windows .
This is my endeavor: try first:
awk -v image = '& lt; Img src = "Resources / logo_small.png" alt = "My image" height = "80" /> '1; Try another:
/ P>
sed 's? & Lt; Body & gt ;? & Lt; Body & gt; \ N \ t & lt; Img src = "resources / logo_small.png" alt = "my image" height = "80" />; G 'overview-frame.html
As a result: The system can not locate the specified file.
For this special purpose, you can use sed
in this way Are:
sed 's? & Lt; Body & gt ;? & Lt; Body & gt; \ N \ t & lt; Img src = "resources / logo_small.png" alt = "my image" height = "80" /> G file name
where file name
is in that file html code. The previous row will print the updated file on the screen, but it will not save the modification in the file: To use -i
to use sed
.
Comments
Post a Comment