Cut

Cut

am 27.11.2007 10:34:12 von sant527

I have an html file.The entire script is in one line only. The
following is the script.

tbody>
Chapter
1: .................................................



In the above script I want to delete the text

tbody>
Chapter
1: .................................................


where ........ represents variable content.

I have 100 files with names 1.htm to 100.htm

How can i do this using unix commands rather than selecting the text
and deleting.

Thanks
Santhosh

Re: Cut

am 27.11.2007 10:44:20 von mallin.shetland

sant527@gmail.com scrisse:

> ...

sed -i 's:

::g' $_a_bunch_of_files

man sed

My two eurocent

PS No, I don't want dollars :D

Re: Cut

am 27.11.2007 10:44:30 von thomasriise

Does it say "

" in all files?

Re: Cut

am 27.11.2007 11:00:24 von thomasriise

for file in `ls *.html 2>/dev/null`
do
cat $file | sed 's/\(.*\)\(

\)\(.*\)/\2/'g >
tempfile
mv tempfile $file
done

Re: Cut

am 27.11.2007 11:37:19 von Janis Papanagnou

On 27 Nov., 11:00, thomasriise wrote:
> for file in `ls *.html 2>/dev/null`

for file in *.html

> do
> cat $file | sed 's/\(.*\)\(

\)\(.*\)/\2/'g >tempfile

sed 's/.../.../g' "$file" >tempfile &&

> mv tempfile $file

mv tempfile "$file"

> done

Janis

Re: Cut

am 27.11.2007 11:43:38 von thomasriise

> sed 's/.../.../g' "$file" >tempfile &&

- point taken