"Bala subramanian" <bala.biophys...@gmail.com> wrote

I have file1.dat,file2.dat...file 300.dat in one directory. I want to concatenate all the files in a single file (total.dat) with a string "END"
separating the file contents.

If you are on Linux (or other *nix variant) you may be better off
using the shell...

for f in *.dat
do
cat $f >> total.dat
echo "END" >> total.dat
done

Will do it for you.
If you are on Windoze then you need to write a batch file and
then execute it within the for loop so I'd just stick with Python
there.  (Or install cygwin :-)

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to