Batch file to remove double quotes from a file

Hi

I have to create a windows batch file which will read an input file and remove "double quotes" from each line of the file.
For eg.If input file name is abcd.csv and contents is :

"asasd,123123,213213,asd"
"esfrf,dsfsdf,234324,sdfsdf"

Then the batch file should remove "" from the start and end of the line and output file should be:

asasd,123123,213213,asd
esfrf,dsfsdf,234324,sdfsdf

Plz help
Thanks

sed 's/"//g' filename

I have to use a windows batch file to execute this.
This command is used in Unix I guess..
Thanks

Akashtcs you can even use a unix machine to remove double quotes, first transferring ur file to unix machine then applying above SED command. Then FTP ur csv files to windows machine. Once i needed to substitute "/" with "\\" as windows accept "\\" instead of "/" in property files and i used this method :slight_smile:

Do you have perl in your windows server?

perl -i.bak -pe 's/"//g' file.bat

No dont have perl in the system,
Also cant do it by transferring the file to unix and doing it...:slight_smile:
There must be something simple in windows to read file line by line and replace a character.

You can download sed for windows and use above mentioned sed command, you can find sed for windows here

Perl or SED for windows could really be great, i didnt know SED was available for windows.
You can also use an editor too, I could substitute doubles quotes with space in Notepad++ after opening .csv file with this editor.

I cannot download anything as it is a server and I dont have the permission.
Also I have to use a batch file only to do this task and not anything else.

---------- Post updated at 04:37 AM ---------- Previous update was at 04:34 AM ----------

Anybody has an idea what is the windows equivalent command of SED?

Hi.

There is no equivalent.

The closest I could find was using findstr, but couldn't get this to work with quotes.

DOS Batch - Find and Replace

If you have no other way, use notepad.

You could use VBA if you have Office installed, here is some example code: - VB ::

Hi again,
there is really no good way of doing what You want (search/replace in text files) in simple cmd.exe. You may want to have a look at other scripting methods (ie vbs or some power tools) or just download a good program that does it for You.

Best regards,
Lakris