Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Notepad command line?

Apr 26, 2006 12:57AM PDT

Hello-

We have purchase orders exported to a .txt file that we ftp to our vendors but certain items contain quotation marks that I need to remove from that file. I currently do it manually by opening it with notepad and replace the quotation mark with nothing, then save and ftp.

Does anyone know a way of doing this automatically? I'm thinking there has to be a simple command file I can run prior to ftp'ing the file to remove the quotation marks contained in the file, but don't know how to write it.

Thank you in advance-

Adam

Discussion is locked

- Collapse -
Don't bother...
Apr 26, 2006 3:53AM PDT

You could write a simple program that does that for you, but unless you have a lot of files you need to remove the quotation marks from (would be time consuming this way), I'd just use the Replace functionality in Notepad, Wordpad, and just about any other word processing program. Just open the .txt file, go Edit->Replace, and tell it to replace all quotation marks with a space, or nothing...it'll simply remove the quotation marks. My note here is that formatting can vary, so you'll want to copy opening quotations marks and paste it into the replace field, then repeat with closing quotation marks.

Hope this helps,
John

- Collapse -
User...
Apr 27, 2006 3:54AM PDT

Thanks John-

If it was me, I'd do it but it's for another user who won't end up doing that twice a day...otherwise you way would be perfect.

- Collapse -
Use sed.
Apr 26, 2006 4:42AM PDT

Adam,

Sed, as you might know (or maybe not) is Unix streaming editor. Very useful for batch edits like this. Finding out the commands to use might take some time; Unix sometimes is a bit cryptic.

You'll certainly find a Windows/DOS version with http://www.google.com/search?q=download+sed+windows
Once you have that, it's up to you to write the command file. It might be useful to know the principle of redirection (reading commands from a file).
I've never used sed (although I've done a little bit of Unix a long time ago), but it seems a sure way to go.

If you like sed, you might try a Windows version of vi (the standard Unix visual editor), just for fun. I mastered only the very basics.

Hope this helps.


Kees