Is it possible to loop a set of numbers?

For example I wish to run a set of number 1,2,3,4,5.....52 but when we get to 52 I wish to go back to 1 and start looping again.

How do write an output file in Fortran?

I have opened a file and moved each character so that each letter has moved for example d to e.....x to y..... How could I write this new series of characters to a file

minger
Not sure what you mean by "run" a set of numbers. If you just wish to print them, then something easy enough like this should work:
Code:
do i=1,n !-- number of times you wish you loop
do j=1,52
write(6,*) j
end do
end do

As far as the second question, you might be best parsing each character in a line, and then concatenating them all to one text string and writing that entire line to file (rather than character by character).