Argv not found (script shell)

I don't know whether it is possible that I ask for help concerning a shel sscript that i wrote and which is not working.
So here is my shell script:

#! /bin/bash

if($#argv != 1) then
    echo "hoge"
    exit
endif

set tgtdir = ../../result
set target = ${tgtdir}/s${argv[1]}/1
set datafile = "agent.csv track.csv knock.csv check.csv"
set paramfile = "agentdata.csv statemap.csv"

echo "experiment 1 start..."
./main 1
echo move to ${target}
if(!(-d ${target})) then
  mkdir -p ${target}
endif

mv ${datafile} ${target}
cp ${paramfile} ${target}

So i attribute the rights for the execution using the chmod +x and then i execute while i m in the directory where the script sheel is located:
./exp.sh 14 but still no directory is created in the directory result and also i got the error argv:command not found ! I cannot find the reason . it might be so clear but i m mind blinded ! Please help me and thanks for your assistance.

It says bash in the shebang, but the syntax looks like csh to me..

Ok so I changed the script as follows :

#! /bin/bash

if($#argv != 1) then
    echo "hoge"
    exit
fi

set tgtdir = ../../result
set target = ${tgtdir}/s${argv[1]}/1
set datafile = "agent.csv track.csv knock.csv check.csv"
set paramfile = "agentdata.csv statemap.csv"

echo "experiment 1 start..."
./main 1
echo move to ${target}
if(!(-d ${target})) then
  mkdir -p ${target}
fi

mv ${datafile} ${target}
cp ${paramfile} ${target}

But still not working! Please help me

You are using the wrong shell. Try using csh instead of bash

I put csh instead of bash and i restore the ancient script but whenever, I try to execute, it did not work at all !

How did you use csh instead of bash ? Did you change the shebang? Show us what you did. I noticed that you changed endif to fi twice, but that is the wrong syntax in csh. If you want to rewrite the script to bash you need to make more changes...

Thanks for your answer. I rewrite the script using the bash syntax while Ihope it is correct but still not working !

#! /bin/bash

if($#argv != 1); then
    echo "hoge"
    exit
fi

set tgtdir = "../../result"
set target = "${tgtdir}/s${argv[1]}/1"
set datafile = "agent.csv track.csv knock.csv check.csv"
set paramfile = "agentdata.csv statemap.csv"

echo "experiment 1 start..."
./main 1
echo move to ${target}
if(!(-d ${target})); then
  mkdir -p ${target}
fi

mv ${datafile} ${target}
cp ${paramfile} ${target}

... more changes as Scrutinizer said:
use if [ ... ]
argv does not exist in bash: use $# and/or $1 .... $n
set has a different function, use tgtdir="../../result" (NO spaces around "="!)
Why do you run ./main ? If that's the name of your script, that'san infinite recursion that will blast your system resources...