develooper Front page | perl.beginners | Postings from July 2003

RE: create files in multi directories

Thread Previous | Thread Next
From:
Ronen Kfir
Date:
July 2, 2003 22:23
Subject:
RE: create files in multi directories
Message ID:
BD570DA5F61970438A5C57CB6E38DC49392322@EX1.tau-centaur.tau.ac.il
Hi Rob,
The text of the files is short (15 words at the most), so it can be either copy of another file, or a text I would edit inside the file.
The names of my directory tree looks like this: 
                                      dir1
		             /     |      \
                           dir2     dir3     dir4
		    /  |         /  |        |     \
	       dir5  dir6 dir5 dir6  dir5 dir6

I want to create a few sets of files. One set goes only to dir5, one set goes only to dir6, etc. the common thing to whole directory tree is the files name. The uncommon thing is the text. In each set, the text stays the same, but only one word- changes. The word, which supposes to be changed, is known- the location in the template, the source & destination.

Cheers

 Ronen Kfir
System Administrator
T.A.U Computing Division
Tel: 972-3-6407416
Fax: 972-3-6405158
cellular: 972-55-405910
E-mail: ronenk@tauex.tau.ac.il


-----Original Message-----
From: Rob Dixon [mailto:rob@dixon.nildram.co.uk] 
Sent: Wednesday, July 02, 2003 8:17 PM
To: beginners@perl.org
Subject: Re: create files in multi directories

Hi Ronen.

You need to give us a foothold here.

Ronen Kfir wrote:

> How would I create a bunch of files with the same name

These files are to be a copy of an existing file? Or have some other prescribed content?

> save them under the same root directory but only in part of the subdirectories

You have constant values of some sort which are the names of the root directory and of
all the subdirectories?

> change one word in the text inside the files?

You know what this word is, where it is to be found (in what is presumably a template file),
and what it needs to be changed to?

Programming is largely a process of rigorously defining a problem using a programming
language. The bulk of the work is describing the problem!

Cheers,

Rob




Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About