Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!v2g2000vbb.googlegroups.com!not-for-mail
From: Rune Allnor <allnor@tele.ntnu.no>
Newsgroups: comp.soft-sys.matlab
Subject: Re: run code on multiple xls files
Date: Sun, 4 Oct 2009 06:37:12 -0700 (PDT)
Organization: http://groups.google.com
Lines: 17
Message-ID: <e5213910-be0b-4624-9781-eb9b619b91b3@v2g2000vbb.googlegroups.com>
References: <haa7r5$are$1@fred.mathworks.com>
NNTP-Posting-Host: 77.16.210.130
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1254663432 8542 127.0.0.1 (4 Oct 2009 13:37:12 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 4 Oct 2009 13:37:12 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: v2g2000vbb.googlegroups.com; posting-host=77.16.210.130; 
	posting-account=VAp5gAkAAAAmkCze5hvZtMeedpZWNthI
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; 
	Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; 
	.NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:574797


On 4 Okt, 15:27, "A Ram" <shal....@gmail.com> wrote:
> Hi,
>
> I currently developed a code that takes in only 1 .xls file and runs an analysis. I was wondering if there is a simple way to change the code to take each .xls file in the current dir at a time, run the current code, and save the outputs for each analysis of the respective .xls file.

Yes:

1) Refactor the present code such that it takes two arguments,
   the names of the input file and the output file
2) Write a loop that calls the '1-file code' and calls it
   with each of the input/output pairs of file names.

Rune