Page 1 of 1

Batch file needed to wrap entire column of text in double quotes

Posted: 07 Nov 2021 07:45
by batchnoob2021
Hi everyone ,

Just joined here to ask this ! I have a text file that has multiple lines without any quotes. I need a batch file that will append a single double quote at the beginning of the first line (not on a separate line by itself , it must be the first character on the first line) I need the same for the very last line position also. So to end up looking like

"One
Two
Three
Four
Five
Six
Seven"

...Therefore wrapping the entire column. I hope you guys can solve this for me as its been driving me nuts ! :)

Thanks in advance !

Re: Batch file needed to wrap entire column of text in double quotes

Posted: 08 Nov 2021 02:24
by OJBakker

Code: Select all

@echo off
> filenew.txt (
   < nul set /p ="""
   type file.txt
   < nul set /p ="""
)
type filenew.txt