Statalist The Stata Listserver


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

st: RE: Re: conversion using dictionary


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: conversion using dictionary
Date   Wed, 5 Apr 2006 23:34:33 +0100

What's missing here is what directories
or folders you are saving these files in. 

To see what is in your current working 
directory, use -dir- or -ls-. The 
dictionary file must be in your current
working directory, unless you specify
another directory. 

When I used dictionaries I found it 
simplest to put the dictionary section
in the same file as the data and always
use the extension .dct for such
files. 

Nick 
[email protected] 

victor michael zammit
 
> I have the following data :
> VictoriaW 8  1 XaghraU
> MunxarF   0  1 ZebbugR
> XewkijaT  2  0 SannatL
> KercemA   0  0 NadurY
> 
> and I would like to convert it to Stata
> 
> The way I proceed is to save it in a do file ,giving it the 
> name of   score
> , which ,by default Stata recognizes as score.do
> and then write the following dictionary :
> dictionary using score.do  {
> str9 a
> byte b
> byte c
> str7 d
> }
> exit
> 
> and save it ,giving it the name of score1,which,by default 
> Stata recognizes
> as score1.dct
> Then I typed interactively  the folowing commands ,but none 
> of them worked :
> 
> 
> . infile using score1
> file score1.dct not found
> r(601);
> 
> . infile using score1.dct
> file score1.dct not found
> r(601);
> 
> . infile using score1.do
> file score1.do not found
> r(601);
> 
> Can  anyone one please tell me how to convert data into Stata 
> with the use
> of dictionary.
> Using the input  command is no problem at all :
> 
> input str9 a byte b byte c str7 d
> VictoriaW 8  1 XaghraU
> MunxarF   0  1 ZebbugR
> XewkijaT  2  0 SannatL
> KercemA   0  0 NadurY
> end
> l,notrim
> 
> 
> . clear
> 
> . do "C:\WINDOWS\TEMP\STD01000000.tmp"
> 
> . input str9 a byte b byte c str7 d
> 
>              a         b         c          d
>   1. VictoriaW 8  1 XaghraU
>   2. MunxarF   0  1 ZebbugR
>   3. XewkijaT  2  0 SannatL
>   4. KercemA   0  0 NadurY
>   5. end
> 
> . l,notrim
> 
>                a   b   c         d
>   1.   VictoriaW   8   1   XaghraU
>   2.     MunxarF   0   1   ZebbugR
>   3.    XewkijaT   2   0   SannatL
>   4.     KercemA   0   0    NadurY
> 
> .

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