Statalist The Stata Listserver


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

st: Re: conversion using dictionary


From   "victor michael zammit" <vmz@vol.net.mt>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: conversion using dictionary
Date   Thu, 6 Apr 2006 00:28:09 +0200

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

.
end of do-file


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index