@Mike
Quote:
|
In the above script - can u explain me in steps
|
I added comments in the script. It is a good idea in any case. I also changed the script a bit.
Code:
# DECLARE VARIABLES.
var str list, file, content, line, columns60_69
# Get a list of all files in directory "/your/directory".
lf -rn "*" "/your/directory" ($ftype=="f") > $list
# $list has file names, one per line. Go thru the list.
while ($list <> "")
do
# Get the next file name from the list. It is on the next line in $list.
lex "1" $list > $file
# The name of the file is in $file.
echo -e "DEBUG: Processing file" " $file
# Get the contents of the file into a string variable.
cat $file > $content
# The entire file contents are in $content. We will now use the same loop
# as the above while loop. The above loop goes thru each file at a time.
# In this loop, we will go thru each line in the file's contents at a time.
# Same concept - process one line at a time.
while ($content <> "")
do
# Get the next line from $content.
lex "1" $content > $line
# Extract characters 60-69 from this content line.
# First, we will extract everything upto (]) 69th character.
chex -p "69]" $line > $columns60_69
# Next, we will extract everything starting with ([] 60th character.
chex "[60" $columns60_69 > $columns60_69
# Now, columns 60-69 of this content line are in $columns60_69.
# Does $columns60_69 contain a dash ?
if ( { sen "^-^" $columns60_69 } > 0 )
# Yes, there is a dash in $columns60_69. Write out
# the name of the file, and the exact line.
echo "FILE " $file ", LINE " $line
endif
done
done
To run this script, copy and paste this script in file "C:/Scripts/C6069.txt", the enter the following command in biterscripting.
Code:
script "C:/Scripts/C6069.txt"
Change the "/your/directory" in the script to the correct path of the directory where these files are located.