here is scenario-
Scan Box # then tapes inside-
Run program from raw scan and makes a newfile with volser#,BOXA01 location kind of thing...
Read on...
I had to destroy 1479 tapes on a pallet for destruction. Scanned each box and then tapes inside-There was 29 boxes with 51 tapes in each box. When I ran thru software my count was then 1333-146 short! I took the input file or raw scan file,
sorted and ran uniq -d > output on file. This gave me 132 tapes. 1333 + 132 = 1465 still 14 short. Then I used a windows freeware program called Agent Ransack to look up each of these duplicate tapes I created with uniq. There were 14 tapes that had were actually triplicates-hence the number of 146-I found a script on the internet to use the file I created as records and run against my BOX# file to see the box locations-but discovered it would only run if I took out the triplicates from the grep_input_file. Can someone help-please!?
Now I found a script on the internet to save the time of looking all these numbers up manually only thing it does not even run if you have 3 or more duplicate volsers of the same value.
(uniq does not care if your file has 2 or 3 more numbers of same volser-it will only find one occurence)
Here is script that only will work with 2 locations of a record.
#!/bin/sh
FILE=main_file
INPUT=grep_input_file
OUT=rpt_grep_output
> $OUT
# greps out lines from the input file and writes to output file:
for i in `cat $INPUT`
do
cat $FILE | grep -iw $i >> $OUT
done
Can anyone hack this to find more than one record from main_file
for example my duplicate file has A10001 in it.
And record A10001 is listed in main_file in three boxes
A10001,BOXA01
A10001,BOXA03
A10001,BOXA04
the program above will not even run-BUT-if I delete the record A10001,BOXA04
the script above will run.
Thanks bryan