-2

I have 800+ HTML files from which I need Code lines 50 - 100 from each file.

I tried Excel macros, terminal and textedit so far but with no luck.

I am looking for an automated solution.

SecretAgentMan
  • 2,856
  • 7
  • 21
  • 41
TomTe
  • 193
  • 9

1 Answers1

1

An example of using sed in a shell

oneliner

sed -i.bak -e '50,100d' *.html

remove lines 50-100 in all files with extension html, save a copy of the original file with a .bak extension.

or in a loop without -i

for file in *.html
do
   sed -e '50,100d' "$file" > "$file".bak
done

best to take a full backup of all files before playing around with sed. and be . aware that sed is implemented with different options in various versions.

MikNiller
  • 1,242
  • 11
  • 17