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: Problem when importing a file


From   Shubhabrata Mukherjee <joy_stat@yahoo.com>
To   stata forum <statalist@hsphsun2.harvard.edu>
Subject   st: Problem when importing a file
Date   Wed, 21 Dec 2011 14:27:30 -0800 (PST)

Hi,

  I am trying to import a text file (created in R) into Stata and having problems with it. Can someone tell me a way to solve this:

The text file looks like the following:

V1 V2 A3 A4

1 0.015 0.986 0.010 0.001
2 0.085 0.975 0.000 0.002
3 0.095 0.900 0.010 0.001
.........
......
...

I used the command insheet using chunk1.txt,  delim(" ")

Two problem occur

1) Somehow I need to delete the the numbers in the first column from the second row onwards (1, 2, 3...) as they are not part of the dataset but was created by the text file as placeholders for each row.

2) At the end there are two variables created ('v110'  and 'v111') where v110 contains the values which should be under A4 and 'v111' gets created because of some end of line issues.

How can I fix these?

 Thanks,

 -Joey


*
*   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–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index