tclsh
puts [ open "flash:resetvlans.tcl" w+ ] {
foreach vlanItem [regexp -all -line -inline "^\[0-9\]+" [exec "show vlan brief"]] {
if { ($vlanItem == 1) || (($vlanItem >= 1002) && ($vlanItem <= 1005)) } {
  puts "Skipping VLAN $vlanItem"
} else {
  puts "Removing VLAN $vlanItem"
  ios_config "no vlan $vlanItem"
}
}
}
tclquit