Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: saving enumerated file names at the end of a loop


From   "Rajesh Tharyan" <[email protected]>
To   <[email protected]>
Subject   st: RE: saving enumerated file names at the end of a loop
Date   Fri, 23 Feb 2007 19:43:30 -0000

Hi,

Try 

save "C:\WINNT\Desktop\\file`i'.dta", replace

note the double slash..

rajesh

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of T.J. Volant
Sent: 23 February 2007 19:39
To: [email protected]
Subject: st: saving enumerated file names at the end of a loop

Hello all,

I'm running a program through bunch of files(
file1.dta, file2.dta, etc) I am opening them and would
like to save them as replace. It opens fine, but
saving doesn't work.

My code:

forv i=1(1)48 {
use "C:\WINNT\Desktop\file`i'.dta"

* body of the program *

save "C:\WINNT\Desktop\file`i'.dta", replace
clear
}

When it saves, it only saves file.data, not file1.dta,
etc. Why?
Thank you very much in advance, 

Tj


 
____________________________________________________________________________
________
Get your own web address.  
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index