Announcement

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

  • How to import excel files with special string characters please?

    Hi everyone,

    I need to import an excel file into stata, but the special characters are not written in the good way, and I don't know how to solve this problem.
    Here is my code:

    Code:
    *********** Car prices 2017 ***************************
    clear all
    version 17
    set more off
    set varabbrev off
    
    
    * Settings specific to local environment (adapt that to your current path)
    // cd path
    global data "C:/Users/miduarte/Desktop"
    
    cd ${data}
    
    
    import excel "./car_prices_2017.xlsx", firstrow allstring locale("es")
    Here is a small -dataex- with data that I obtained:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input str13 marca str639 modelo
    "VOLVO" "XC 90 HÃ*brido T8 Twin Inscription AWD"
    "VOLVO" "XC 90 HÃ*brido T8 Twin Momentum AWD"  
    "VOLVO" "XC 90 HÃ*brido T8 Twin R-Design AWD"  
    end
    Thank you in advance for your help.
    Michael

    Edit: My Stata's version is 17.
    Last edited by Michael Duarte Goncalves; 19 Dec 2023, 03:50.
Working...
X