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]

st: RE: RE: comas in numbrers


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: comas in numbrers
Date   Wed, 28 Apr 2010 11:11:51 +0100

Steve gave good advice. In addition any decent text editor will do this,
as will Stata. See -filefilter-. 

Nick 
[email protected] 

Steve Samuels

Victor, you can skip all the problems of adding quotes or destringing
by deleting the commas outside of Stata. Use the SED package, built
into all the Unix, Linux, and OS X distributions and also available
for Windows.  Write the data into a text file, say file1.txt.  Here is
an example:

**************************CODE BEGINS**************************
/*
 File file1.txt contains the following two lines with three variables
3,000,000 4,000,000    .
     40,000   300,000 100
*/
capture erase file2.txt
! sed  -e 's/,//g' file1.txt>file2.txt

infile v1 v2 v3 using file2.txt, clear
des
list
***************************CODE ENDS**************************



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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