Sed or Awk or both to edit file

What is an efficient way to remove all lines from the input file which contain a file name?

inputfile:

=======================
# comment
# comment
# comment

5   8   10   /tmp

5   8   10   /var/run

5   8   10   /etc/vfstab

5   8     9   /var/tmp

5   8   10   /var/adm/messages

=======================

Desired out put: change all numbers to "1 0 0" and remove lines which contain a file name

=======================

# comment
# comment
# comment

1    0    0   /tmp

1    0    0   /var/run

1    0    0   /var/tmp

========================

My current approach have not addressed "removing line which contain a file name.

#!/bin/ksh
######################################################################
#CREATION DATE: 10/05/2009
#AUTHOR: Jan De Wulf
#SCRIPT TITLE: correct_tivoli.ksh
#PURPOSE: adjust thresholds in /opt/Tivoli/lcf/dat/1/.dm/diskmon/diskmon.cfg
#USAGE: run on target server
#NOTES: Reduces the number of needless Tivoli "disk space threshold alerts"
#MODIFIED:
######################################################################

#====== VARIABLES ========
=/opt/Tivoli/lcf/dat/1/.dm/diskmon/diskmon.cfg
SED=/sysadmin/bin/tivoli_adjust.sed
#====== VARIABLES ========

if test -s $X; then
   cp -p $X $X.`date +%Y%m%d`
########## Set DISCOVERY to OFF and set all thresholds to "1   0   0"
   sed -f $SED $X > /tmp/$Y.`date +%Y%m%d`
     if test -s /tmp/$Y.`date +%Y%m%d`
      then
         if cmp -s $X /tmp/$Y.`date +%Y%m%d`
         then
            echo "file not changed:"
            rm $X.`date +%Y%m%d`
         else
            cp /tmp/$Y.`date +%Y%m%d` $X
            echo "Editing of file completed"
         fi
      else
       echo "Sed created an empty file"
     fi
   rm /tmp/$Y.`date +%Y%m%d`
else
   echo "original file is blank"
fi
bash-3.00#
#
######################################################################
#CREATION DATE: 10/05/2009
#AUTHOR: Jan De Wulf
#SCRIPT TITLE: tivoli_adjust.sed
#PURPOSE: sed script to correct /opt/Tivoli/lcf/dat/1/.dm/diskmon/diskmon.cfg file
#USAGE: Used by other script or on the command line "sed -f tivoli_adjust.sed xxx
#        where xxx = file name to be edited
#NOTES:
#MODIFIED:
######################################################################


s/DISCOVERY=ON/DISCOVERY=OFF/g
{
s/[01-9].[0-9].[0-9][0-9]/1     0       0/g
s/[01-9].[0-9].[0-9]/1  0       0/g
}
bash-3.00#

Thanks Pludi for fixing my post and showing me the ropes.

A point to start from (presumably more understandable than "geeky efficient", though :rolleyes:):

cat in.file | while read LINE
do
  ENTRY=$( echo $LINE | sed 's/\([ \|0-9]\)//g' )
  if [ -f $ENTRY ]
  then
    echo "'$ENTRY' refers to file"
  elif [ -d $ENTRY ]
  then
    echo "'$ENTRY' refers to folder"
  fi
done

Dr House thank you, its getting me further. Was not familiar with the shell scripting syntax of the file and directory test. The sed string works just about perfect, however as it strips all numbers this creates a problem with file names which contain numbers. I am currently going down the awk path however i am not there yet. Again thank you for your input

[house@leonov] echo "1 2 3 /0tmp0" | sed 's/\([ \|0-9]\) //g'
/0tmp0

Dr.House finally hit the jack pot. again thank you for your contribution which help me move forward along to my destination:

{
if (sub(/DISCOVERY=ON/, "DISCOVERY=OFF"))
print $0
if ( $1 ~ /^#/ ) {
        print $0 }
if ( NF == 4 ){
    if ( system("test -d " $4) ) {
         }
    else {
        print "1        0       0       "$4 "\n" }
}
}

bash

#!/bin/bash
while read -r a b c d
do
 case "$d" in
    */* ) 
        if [ -f "$d" ];then
           continue
        fi
        ;;
 esac
 echo "$a $b $c $d"
done < "file"

ghostdog74 for "while read -r a b c d" what does the -r option do? and what does "a b c d" represent, different input file? different line? different field?