| 1. |
Solve : How to delete double quotes from a CSV file? |
|
Answer» How do I delete all of the double quotes (") from a CSV file? I am using Windows 7 64-bit.setlocal enabledelayedexpansion That looks like an SQL Prompt? Is that what it is? I wondered if it was a heavily nonstandard cmd.exe prompt, but your theory makes more sense. Quote from: Salmon Trout on July 12, 2012, 01:43:40 PM It's as "close" as you are going to get. Why you aren't creating after.csv in the same folder may be a question of write permissions, or perhaps it is there and you have missed it? I tried the script from a PREVIOUS topic that you also wrote and had no problem generating an output file. The output is going to the same folder as the input, which is on my HARD drive. I like the echo because it tells me that the desired string is being generated in memory, but the output file is not appearing. Unfortunately, it's been a decade or so since I used DOS regularly. I'm just trying to find a way to update my data that is faster/better than importing it to EXCEL, running a macro, then saving it back out, or writing a separate .NET app to parse the file, given the requirements I'm constrained to at the moment, a CUSTOM SQL query program at my workplace that can run DOS commands. I do appreciate your effort to help.On thing you could try is putting a drive/folder specification for the output, just to make sure it's going where you think/want it to go.Maybe you could do this (echo to console & redirect to an output file) SQLP>RemoveQuotes.bat > after.csv @echo off setlocal enabledelayedexpansion for /f "delims=" %%A in (before.csv) do ( set csvline=%%A echo !csvline:"=! ) That worked. Thanks! |
|