Statalist The Stata Listserver


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

Re: st: basic string operations


From   "Ada Ma" <[email protected]>
To   [email protected]
Subject   Re: st: basic string operations
Date   Mon, 17 Apr 2006 12:06:48 +0100

Please see replies slotted-in in between your original email:

On 4/17/06, Alexander Nervedi <[email protected]> wrote:
> Hi!
>
> I have a dictionary in a set of folders and data in another folder.
>
> global dict "C:\Program Files\ .......\Dict"
> global data "C:\Program Files\ .......\Data"
> gloabl filename "file2 ... file 200"
>
> Now I need to place a call like
>
> inflie "C:\Program Files\ .......\Dict\file.dct", using("C:\Program Files\
> .......\Data\file1.raw"
> tempfile data
> save "`data'"
>
> for file in `filename'{
>
> inflie "'$dict`$file.dct' ", using(" $data'$var' ")
> append "`data'"
>
> }

I have no idea how the -for- command works in here.  Plus I have no
idea what $var is, I suppose it's a list of variables you want to pull
out from all of the data sets?  What I know should work is this:

foreach file in $file {
infile $dict\\`file', using ($data\\`file')
save $store\\`file', replace
}

I have no idea how to integrate the list of variables you'd like to
select into this loop.

That's all I can do.  Hope it helps!

Cheers,
Ada

>
> the code keeps bailing at the for loop insheet saying it cant chaneg
> directories. is there a neat way of specifying directory changes with two
> strings ?
>
> any help would be really great. i have been banging my head on this for a
> bit.
>
> alex
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
> *
> *   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/
>


--
Ada Ma
Research Fellow
Health Economics Research Unit
University of Aberdeen, UK.
http://www.abdn.ac.uk/heru/
Tel: +44 (0) 1224 553863
Fax: +44 (0) 1224 550926

*
*   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