What language to manipulate text files

Dan Christensen jdc at uwo.ca
Sun Jun 12 15:41:52 EDT 2005


ross <rossnixon at gmail.com> writes:

> What are the ideal languages for the following examples?
>
> 1. Starting from a certain folder, look in the subfolders for all
> filenames matching *FOOD*.txt Any files matching in each folder should
> be copied to a new subfolder within the current folder called EATING
> with a new name of *FOOD*COPY.txt

Bash?  

  for f in *FOOD*.txt; do cp ${f} EATING/${f}COPY.txt; done

Or "mmv", a linux utility:

  mmv '*FOOD*.txt' 'EATING/#1FOOD#2COPY.txt'

For the rest, I personally for choose python.

Dan



More information about the Python-list mailing list