[Tutor] concatenating files
Alan Gauld
alan.gauld at btinternet.com
Sat Feb 28 01:46:14 CET 2009
"Bala subramanian" <bala.biophysics at 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.
> my total.dat should be
> file1.dat contents
> END
> file2.dat contents
> END
> ----
> ----
> file300.dat.
>
> now i have another 400 such *.dat files in another directory whose
> contents
> i hve to append to "total.dat", how can i do this task. i need to do
> something like, updating the file total.dat without overwritting it.
>
> Thanks,
> Bala
>
--------------------------------------------------------------------------------
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
More information about the Tutor
mailing list