reverse first field from the file

Hi all,

I have a file named file1as

07/25 00:10 d327490
07/25 00:55 d378299
07/25 03:58 d378299
07/25 06:14 d642035
07/25 12:44 c997126

and now i want to reverse the first filed ie 07/25 as 

25/07 00:10 d327490
25/07 00:55 d378299
25/07 03:58 d378299
25/07 06:14 d642035
25/07 12:44 c997126

kindly reply me its urgent

thanks in advance

IFS="/ " while read A B C
do
        echo "$B/$A $C"
done < inputfile > outputfile

Hi corona ths for a prompt reply can u pls help me

i have put the above code in ascript and run it

its giving me this error

$ new.sh
new.sh: while: not found
new.sh[2]: syntax error at line 3 : `do' unexpected

What shell are you using? It needs a bourne shell. Try putting #!/bin/sh as the first line, or running it like sh scriptname

HI corona i have tried it as this

awk '{print $1}' inputfile|cut -c 4-5;awk '{print $1}' inputfile|cut -c 3;awk '{print $1}' inputfile|cut -c 1-2

but the output is as

25
25
.
.
.
/
/
.
.
07
07
07

---------- Post updated at 04:30 AM ---------- Previous update was at 04:23 AM ----------

Hi corona,

im using k shell

$ sh new.sh <file1> out
new.sh: while: not found
new.sh: syntax error at line 4: `do' unexpected
$ cat new.sh
#!/bin/sh
IFS="/" while read A B C
do
echo "$B/$A $C"
done

can you spot the difference?

I hope this helps.

bakunin