Problem renaming file.


G

Gene E. Bloch

Peter Jason said:
I'll explain the steps I use:

From Google patents I download a pdf file and OCR
it with Acrobat X.

I want to save all the downloaded patents in a
folder called "Patents".

I open the Windows Notepad.

I go to the OCR'd patent and copy the patent
number and dump this into Notepad.

I go to the patent and copy the title and dump
this into Notepad next to the patent number.

Then I copy the contents of the Notepad and try to
paste this into the Windows file field, but here
I get the error message that lists the forbidden
file characters.
1 - There exists the target file.
2 - Open the target file to find a string (patent number). Copy it into
the clipboard. Copy it from clipboard into a temp text file. Close
the target file (so it can be renamed later).
3 - From somewhere else, get another string (patent title). Copy it
into the clipboard. Copy it from clipboard into a temp text file so
it appends onto the prior string.
4 - From the temp text file, copy the concatenated string obtained from
#2 & #3 into the clipboard.
5 - Rename the target file. Copy the string in the clipboard into the
rename dialog.

The only reason the temp file is needed is because the Windows clipboard
only lets you get at the last clip. Other clip managers let you access
multiple clips and append them together. The process could be
streamlined a bit by doing:

1 - There exists the target file.
2 - Open the target file to find a string (patent number). Copy it into
the clipboard. Close the target file.
3 - Rename the target file. Paste in the string obtained from #2.
Leave the rename dialog pending (don't exit it).
4 - From somewhere else, copy another string (patent title) into the
clipboard.
5 - Append the string obtained in #4 to what was already entered in #3.

While the number of steps doesn't change, you only use the Windows
clipboard to record one string at time and use it before it changes.
There's no need to bother with a temp file edited with Notepad where you
concatenate the strings.

I'm wondering if formatting is getting in the way. You are copying a
string (patent number) from a PDF doc and copying another string (patent
title) from a different source. The result may likely include
formatting or the doc structure in what got copied. You might also be
highlighting "text" in a document but inadvertently include the
linebreak which doesn't show in the rename dialog. In other clip
managers, you can convert a clip to plain text to ensure all formatting
gets removed plus they may indicate when there are special (hidden or
non-printing) characters, like linebreaks, tabs, null, or backspace.
When using the Windows clipboard, there may be more in the clip than
just the text you can see. For example, when copying from an HTML doc,
you have to be careful how you copy the string. Copying forward from
the 1st to last character of a string that is the last in a line will
result in including the linebreak character. Copying from the end of
the string backwards to the first wanted character will eliminate the
linebreak. For HTML, I've gotten into the habit of copying backwards
from last character and left and up to the first character of the wanted
string. My clip manager (Clipmate), for example, when copying a string
from an HTML doc, has a Text and Text As HTML view. The Text view
strips out all the formatting. The Text As HTML shows me what it looked
like in the original doc; i.e., it shows with bolding, italics,
underlining, fonts, etc from the HTML formatting. If the string was
copied from an RTF doc (e.g., Word .doc file) then Clipmate shows me
another tab to view as RTF. If Clipmate is showing me 3 tabs for Text,
Text [as HTML], and RTF, what I paste depends on which tab I select.
Obviously the clip still contains all the HTML or RTF formatting which,
when using the Windows clipboard, could end up where you paste the clip.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms649015(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/ms649013(v=vs.85).aspx

As a consequence, many 3rd party clip managers (but not all) provide
some means of selecting if you want to use the clip (during a paste or
stored within their clipbase) as plain text or to include any formatting
that is included in the clip (but which you may not see when pasting in
a different program). If you don't want to bother supplanting the
Windows clipboard with a 3rd party clip manager, there are utilities
that will modify the current clip residing in the Windows clipboard to
plain text, like:

http://www.extrabit.com/plaintextclipboard/
(converts to plain text the current clip in the Windows clipboard)

http://www.stevemiller.net/puretext/
(converts to plain text when pasting the current clip)

http://www.techsupportalert.com/remove-unwanted-formatting-from-text.htm

I don't know and haven't found a native Windows keyboard shortcut combo
that will copy the selected text to the clipboard while also stripping
out "bad" characters along with any formatting. I think you were
presuming that pasting into a .txt file via Notepad would do this
stripping of non-printable characters or formatting content. I don't
know if Notepad in Windows 7 will strip out non-printable characters or
formatting from a clip pasted into it.

While the patent number and patent title might be longer than you care
to view, remember, and then insert into a rename dialog, you should try
this manual scheme with one of your downloaded .pdf files to see if it
works. With copy-n-paste, there could be characters in the concatenated
strings that you cannot see. For example, null is a valid filename
character that you normally cannot type into a field but the clipboard
may retain it. The clip might have "number···title···" where the · are
ASCII 0 for Nul, or 127 for DEL, or 255 non-printing whitespace. The
user interface doesn't permit the full range of acceptable filename
characters the file system will allow. Programs can insert characters
into filename that you cannot via standard input dialogs.

What gets into the clip may be more than you can see and not what you
want to include.
Many thanks, but it may be faster and easier just
to type in the name.
I'll do the cut & paste but then just manually
copy the text beneath this and copy this across.
That kind of thing has worked fine for me. Yes, it's a bit of a
nuisance, but it's better than the alternative :)
 
Ad

Advertisements


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

Similar Threads


Top