computing
  • 2

Removing Double Quotes From a Text File?

  • 2

I am very new to MSDOS/batch files, but I have a question…

I have a text file (lets call it C:\myText.csv) and I am trying to remove all double quotes from the text file. myText.csv is a scheduled to be updated daily with new information, but the program which it gets its text includes double quotes around text values as well as around each row, and sometimes includes quadrouple quotes around text (e.g. “””hello””,””world””,5″).

Anyway, is there an easy way to eliminate the quotes? And if not, can someone help me with this code, or point me in the right direction?

Thanks!!!

Share

1 Answer

  1. Here the NT/4.0 version

    @echo off
    type nul > “myText.new”
    for /F “delims=” %%A in (‘type “myText.csv”‘) do call :EDIT %%A
    del “myText.csv”
    ren “myText.new” *.csv
    goto :EOF

    :EDIT
    set row=%*
    set row=%row:”=%
    echo.%row%>> “myText.new”
    goto :EOF

    • 0