Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • basic infile question, foreign character

    Can't find solution via manual or forum. Attempting to read in thousand of fixed format text files, without delimiters. If there is a foreign character in field, I cannot read subsequent fields correctly. A streamed down example below. In any text editor, variable X always as the value X and appears fine. When I apply the dictionary below, the read is only correct in rows 1, 3, 5 - when no foreign letter is in the preceding variable. Posting to this forum appears to remove fixed format, possibly obscuring my issue.

    Perplexed - tried infix and other approaches. Thanks in advance.

    infile dictionary {
    _column(1) str50 varone %50s
    _column(56) str1 X %1s
    }
    CHI JOUE DANS LE JARDIN X
    LE MYSTÈRE DES BISCUITS X
    LES CANARDS X
    CAP SUR LA PRÉHISTOIRE 1ÈRE PARTIE X
    SERPENT X

  • #2
    It's an encoding issue. Now wrestling with unicode command documentation. Thank you.

    Comment


    • #3
      I'm not sure I understand but the following may help:
      Code:
      h hexdump
      h filefilter
      if you use -hexdump- be sure to use one of the options as you do not want a full dump

      after using -hexdump-, you can use -filefilter- to replace any characters (or sets of characters) to something else (e.g., ASCII) and then once the data are in Stata, you can change again if you want

      Comment

      Working...
      X