I see now. In fact your code did tell us what is going on.
As you instructed, -save- will save the data as a Stata data file but
with its original name and not with a .dta suffix. So, you should be
read in each file with -use-.
Nick
P.S. -fs- is a user-written command from SSC.
On Mon, Apr 2, 2012 at 9:36 AM, Abhimanyu Arora
<abhimanyu.arora1987@gmail.com> wrote:
> Hi Nick
> Thanks for your email.
> The problem as I perceive is that due to that line in the code -save
> `file', replace- stata has changed my original *.csv files. Here is
> one example on what a structured *.csv has been reduced to.
> http://screencast.com/t/HU1Y4cPGelf
> Before running the loop it was a table with numbers, the first column
> being the time variable and each subsequent column being a time
> series.
> I was wondering whether there is a way to make stata reverse the process.
> Hoping against hope
> Abhimanyu
>
>
>
>
> On Mon, Apr 2, 2012 at 10:28 AM, Nick Cox <njcoxstata@gmail.com> wrote:
>> Without information on the _precise_ problem here, I think we are
>> reduced to guessing. My guess is that you need to go back to the
>> original *.csv.
>>
>> What "strange characters"? What does "not recognizable completely"?
>>
>> Nick
>>
>> On Mon, Apr 2, 2012 at 9:01 AM, <owner-statalist@hsphsun2.harvard.edu> wrote:
>>
>>> My data was in around 50 csv files in one folder. I wanted to merge
>>> the data into a single stata dataset. So I used the following commands
>>> in order to first create 50 stata datasets to be merged.
>>>
>>>
>>> fs
>>>
>>> foreach file in `r(files)' {
>>> insheet using `file'
>>> save `file',replace
>>> clear
>>> }
>>>
>>> I now discover that the csv files have strange characters and the data
>>> is not recognizable completely. Do you think it would be possible to
>>> retrieve my data?
*
* 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/