Skip to main content
2 of 2
deleted 42 characters in body
Janis
  • 14.4k
  • 4
  • 28
  • 42

With GNU awk (version 4.x) try this:

awk 'ENDFILE { printf "%d %s %s %s\n", ++c, $8, $9, $10}' *mcp > "${Pout}${output}"

echo "Finished Looping through each file."

With other awks and shells like bash try:

for f in *mcp
do
    awk -v c="$((++c))" 'END { printf "%d %s %s %s\n", c, $8, $9, $10}' "$f"
done > "${Pout}${output}"

echo "Finished Looping through each file."
Janis
  • 14.4k
  • 4
  • 28
  • 42