Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Append the Contents of Fixed Width Text File


From   Rijo John <[email protected]>
To   stata <[email protected]>
Subject   Re: st: Append the Contents of Fixed Width Text File
Date   Sun, 18 Aug 2013 00:03:35 +0530

That sounds good. But how will I specify the dictionary file then?
At the moment it starts like

dictionary using f1.txt {
_column(4) var1 %5f
_column(30) var2 %1f
-------------
------------
-----------
}

For the below program to work the dictionary file (dict.dct) should
not contain the file name f1.txt.




On Sat, Aug 17, 2013 at 11:37 PM, Steve Samuels <[email protected]> wrote:
> You say you need to append the files together first.   Why first?
>
> Something like this should produce the same result.
>
> . save d1, replace emptyok
> . foreach f in f1 f2 f3 {
> . clear
> . infile using dict.txt, using(`f'.txt).
> . gen source = "`f'"
> . append using d1
> . save d1, replace
> }
>
> Steve
>
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index