How to export to txt and use "-sign

X

X-Ray

I want to make a batch rename file. Therefore I put the commands and
parameters in columns in Excel and save this to a txt file.
But I run in to the following problem. When a filename contains a white
space I have to enclose the name between double quotes. But when I do this in
Excel and make an export extra quotes are added.
How do I add the double qoute sign the right way ?

Example (|-sign to indicate columns):

Excel:
rename | filename.pdf | "file name.pdf"

Export to txt:

rename | filename.pdf | """"file name.pdf""""
 
P

Pete_UK

You could enter it into the cell as a formula, like this:

=CHAR(34)&"file name.pdf"&CHAR(34)

and this will give you:

"file name.pdf"

Hope this helps.

Pete
 
J

Jacob Skaria

Why dont you just open the .txt file in a notepad and do a find/replace

Find: """
Replace: "

If this post helps click Yes
 
D

Dave Peterson

You could use a helper column (column D??) that contained formulas like:

=a1&" """&b1&""" """&c1&""""

Then copy that column and paste into a notepad file. Then save that file as
something.bat
 
X

X-Ray

Nice workaround, I completely didn't think of it. But not really desirable. I
prefer to not have any actions outside Excel, so I can further automate the
actions in Excel.
 
X

X-Ray

Nice and simple workaround to copy the selection to notepad. But not really
desirable. I prefer to not have any actions outside Excel, so I can further
automate the actions in Excel.

And I already tested to make use of a helper column. But thanks anyway.
 
X

X-Ray

I have found a solution. When I save as "Space delimited (*.prn)" there are
no extra quotes added.

Thx everybody for your suggestions.
 
X

X-Ray

I forgot to mention that it is still necessary to enter the quotes yourself,
but there are no extra qoutes added.
 
D

Dave Peterson

If you really don't want any actions outside of excel, maybe you should have a
macro that runs against the data--avoiding the .bat file completely.

Excel's VBA has its own Name command (see VBA's help) to rename files.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top