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: st: Re: st: Re: st: Re: st: Problems with insheet with non-standard delimiter ø


From   Lucas Ferreira Mation <[email protected]>
To   [email protected]
Subject   st: Re: st: Re: st: Re: st: Re: st: Problems with insheet with non-standard delimiter ø
Date   Tue, 31 Jul 2012 16:34:42 -0300

. insheet using "foobar.txt" ,delim(`= char(248)') clear // does not work.

The problem is that insheet will not recognize the  "ø"  (`=
char(248)') in the text. For some reason "insheet" will interpret it
as two characters: "ø"  (  `=char(195)'  and   `=char(184)'  ) and
the delimiters option will not accept two characters as delimiters. So
the solution was first to replace ø with ø . Like this :

. local dat_name  example_dataset.txt
. filefilter `dat_name'.txt `dat_name'2.txt , from(`= char(195)'`=
char(184)') to (`= char(248)')
. insheet using `dat_name'2.txt ,delim(`= char(248)') clear

this kind of works, but some lines became corrupted. I´ll try to
export a better file in MSsql Server, with double quotes encapsulating
text fields.

again thank very much
Lucas


On Tue, Jul 31, 2012 at 10:43 AM, daniel klein
<[email protected]> wrote:
> Lucas,
>
> I copied your example from the Statalist archives. Have a look at
> Stata's -char()- function. If you know the ASCII code of the
> delimiter, you may code something like
>
> . insheet using "foobar.txt" ,delim(`= char(248)') clear
>
> where you replace 248 with the ASCII code. Number 248 is my guess,
> based on the output you get from -asciiplot- (Blasnik, Juul, Cox)
> available from the SSC.
>
> Also, you should update to Stata 11.2.
>
> Best
> Daniel
>
> --
> Dear Daniel,
>
> thank you for the answer. I tried on my desktop: Windows 7
> Professional with Stata 11.1 and on a Sever with Windows Server 2003
> and Stata 10.1. Neither works.
>
> it is funny how these letters keep changing.
> In my original database and email I had the letter ř (which is printed
> typing : ALT +155 (with the numbers keyboard part)
> In your code bellow, at least the way I see it here,  you have used
> the letter shown here:
> http://unicode.org/cldr/utility/character.jsp?a=0173
>
> regards
> Lucas
>
> *
> *   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/

*
*   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