You should be more specific. Something like
Code:
for f in *; do
mv $f /path/to/$(grep NAME $f)
done
would be along the lines of what you want but almost certainly wouldn't get it as is. If you had a couple of files in the current directory called 'foo' and 'bar' and the contents of foo were
hello
123
and bar was
goodbye
789
and you grepped for '[0-9]' it would move them to /path/to/123 and /path/to/789.