Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Script to insert lines in a file
Name: sandeep Date: May 7, 2003 at 22:16:21 Pacific OS: HP-UX CPU/Ram: p2
Comment:
Hello all, I have wriiten a script to create a html file on the fly. It is as shown below :-
1>echo " " > log.html 2>cat test.log >> log.html 3>echo " " >> log.html The log.html file puts the test.log in html format so that it can seen from a browser. The problem is @ line 2. The file test.log is huge & it looks very clumpsy in the log.html (when seen from the browser).
Cud u guys suggest some way in which i can insert line break tag in between every line in log.html. It can be either when the file is being created (cat test.log >> log.html) or after the log.html file is created.
Name: sandeeprk Date: May 7, 2003 at 22:43:51 Pacific
Reply:
the last few lines r missing. so i thought i 'll just add it.
The log.html file shud look like HTML BODY CONTENTS OF test.log br ----------- this is break line in html CONTENTS OF test.log br CONTENTS OF test.log br BODY HTML
0
Response Number 2
Name: David Perry Date: May 8, 2003 at 04:41:12 Pacific
Reply:
What you would like then is for each line of test.log to be terminated with in addition to the line feed.
sed -e 's,$,BR,' test.log >> log.html
This forum strips the less than tag. Please wrap the BR in less than and greater than marks.
Summary: I was wondering if you could help me with a script to remove ALL the lines in a file that contain the word "BOUNDARY". I have the script like this so far, but It will only remove the first occurance ...
Summary: hi, I am trying to write a script to delete few lines from the existing files. The requirement is as follows: 1. I need to grep for a pattern "abc" in a file and then grep for "xyz" 2. I need to delet...
Summary: my problem is i want to replace a line in a file e.g i want to replace the line DBUID= (some name) with DBUID=$user variable file name is sample.ksh DBUID=aruns010 please help me in solving this pro...