Announcement

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

  • Unzip file without creating archived folder

    Hi Everyone,

    I have a zipped file C consisting of two files A.csv and B.csv
    I save the zipped file C in the directory /$input
    I want to unzip this file C and save the file A and B to folder "input" like: /$input/A.csv and /$input/B.csv.
    But I used the code below and it always create a new folder named C to store A and B like: /$input/C/B.csv.
    Could anyone help me to unzip this file C without create a new folder C?

    cd $inputs/
    unzipfile "C.zip", replace

    erase A.csv
    cd ../../..
    insheet using "$inputs/B.csv", clear
    keep distance milesflown
    save "$temp/B.dta", replace
    erase "$inputs/B.csv"

    I couldn't run the last 6 lines because of the above issue.
    Thank you very much!!
Working...
X