Bash script with awk command ERROR

Hello im new here... Im trying to read file and create folders from words in it but i get this for loop error
awk : line 3 : syntax error at or near for

my code is..

#!/bin/bash
begin
for (( i=1;i<=5;i++));
do
awk -v i=$i $0 { print $i }
mkdir $i
done
{print $i}
end {}

i have tried for ... without ";" it doesnt work either.
I need to run this script using: awk -f myfile textfile
Any ideas? im desperate here...

change for loop as below:

for i in {1..5}

Now i get 2 erros...
awk : line 3 syntax error at or near for
awk : line 4 syntax error at or near do

any other ideas? Maybe i need to use different script like sh or ksh?

Have you tried something like this?

#!/bin/bash

while read line
do
  mkdir "$line"
done < "$file"

I get same error just with while now.
How can this be happening?

Post an example of your inputfile.

Not sure what the begin and end are meant to be. Put the awk script in single quotes, and give it an input file to work upon.

It is an overkill to use awk inside bash if you can use bash alone to achieve your requirement:

#!/bin/bash

while read word
do
        for i in 1 2 3 4 5
        do
                mkdir "${i}${word}"
        done
done < file

Replace file with your input file name.