
JenniC
Novice
Apr 7, 2009, 9:53 AM
Views: 1855
|
|
Biterscripting script that adds a copyright notice in every .html page.
|
|
|
Hi arjunetal: You said: So exactly what I want is to add <p>How are you</p> before </body> tag. This can be done very simply with biterscripting. (I had the same problem - wanted to insert copyright notices at the end of each page in tons of pages. Someone pointed me to biterscripting. It works great !) Here is a script. I will assume your html page is at C:/mysite/page.html. # Read in the page into a variable. var str page ; cat "C:/mysite/page.html" > $page # Insert "<p>How are you</p>\n" before "</body>". sin -c "^</body>^l" "<p>How are you</p>\n" $page > $page # Write page back. echo $page > "C:/mysite/page.html" You can also do this for all .html files in a folder (and subfolders). Use the following script. # Collect a list of .html files var str list ; find -n "*" "C:/mysite" > $list # Process one file at a time. while ($list <> "") do # Get the next file. var str file ; lex "1" $list > $file # Call the above code # Change cat "C:/mysite/page.html" > $page to cat $file > $page # Also, change echo $page > "C:/mysite/page.html" to echo $page > { echo $file } done If you don't have biterscripting yet, download it free from http://www.biterscripting.com. Download and install all their sample scripts using the following command. Jenni
(This post was edited by JenniC on Apr 7, 2009, 9:54 AM)
|