Do you know the names of all the files that have the old field name in them? If you don't, you can use: find . -print | xargs grep "old field name" to get a list of the files that have the old field name. You could write the list to a file.
Then you can use an awk command to make the changes. Maybe:
for line in 'cat list.txt' [from your find command]
do
awk '{ print $1 'new field name' $3 $4 }'
done
You may have to play around with the part betweeh the { } for correct spacing, etc.
[tt]FILES=`find . -type f`
echo $FILES | while read FILE
do
sed 's/old string/new string/g' $FILE > $FILE.$$
mv $FILE.$$ $FILE
done[/tt]
should work too.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.