Problem renaming file.

P

Peter Jason

Win7 SP1

I download documents with filenames including * /
\ | % etc.

Before I save these documents I remove the
offending forbidden characters, but Windowws still
refuses to save them.

How can I save them?

Peter
 
N

Nil

Win7 SP1

I download documents with filenames including * /
\ | % etc.

Before I save these documents I remove the
offending forbidden characters, but Windowws still
refuses to save them.

How can I save them?
Downloading of files isn't a Windows function. You need an application
like a web browser or FTP program to do it. What do you use? Where do
the files come from? Have you tried using a different program? What is
the error message?
 
V

VanguardLH

Peter Jason said:
Win7 SP1

I download documents with filenames including * /
\ | % etc.

Before I save these documents I remove the
offending forbidden characters, but Windowws still
refuses to save them. How can I save them?
Give an example of a URL where there is a download link for a file with
a backslash character. That is an illegal character in a URL's path
section or parameters unless you use ISO entities for those characters
to encode them within the URL. For example, backslash would have to be
encoded as %2F and a space is %20. That means you would have to modify
the URL if directly put into a dialog box to change the ISO entities
back to normal characters.

<path>/<otherparms>&url=http%3A%2F%2Fpuzzles.usatoday.com

is using %3A for the colon (":") and %2F for the backslash. If the
colon and backslashes were actually in the URL, parsing would get
screwed up because you would have a URL inside a URL. If your
non-described method for "downloading" happens to insert the encoded URL
then you'll have to decode it.

This is where a vague question results in equally vague responses. Give
an example of a web page (its URL) and on what you click for the URL (or
script) for the file to download that results in the problem within a
specified application where you try to modify the Save As (target)
filename but the save operation fails along with the actual error you
get for that failure. Show what you are trying to download, what you
are using, and what you are editing (from and to) for the target
filename.
 
B

BeeJ

It happens that Peter Jason formulated :
Win7 SP1

I download documents with filenames including * /
\ | % etc.

Before I save these documents I remove the
offending forbidden characters, but Windowws still
refuses to save them.

How can I save them?

Peter
I have gotten filenames with hidden (non-printing) characters. These
are verboten in Windows. So you need to totally wipe the name and type
in all new characters not just edit out the visible bad characters.
 
P

Peter Jason

Downloading of files isn't a Windows function. You need an application
like a web browser or FTP program to do it. What do you use? Where do
the files come from? Have you tried using a different program? What is
the error message?
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.

Peter
 
C

Char Jackson

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.
I hope Nil (or someone) can make sense of that. I read your steps
several times and couldn't figure out what you're doing or what the
error message might be.
 
P

Peter Jason

I hope Nil (or someone) can make sense of that. I read your steps
several times and couldn't figure out what you're doing or what the
error message might be.
I can't explain it more lucidly. I simply want
to name the pdf file with a name made up of two
others.
 
N

Nil

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.
I don't know if I understand your description, but my guess would be
that your file name includes tabs or some other invisible whitespace
character other than a plain space. That is not allowed. Type in a
legal file name and save it. Then examine the contents of the file with
a text editor that will display the hex values of the "text", or with a
hex editor (I suggest XVI31,
<http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm>
I bet you will see your problem characters in there. You will have to
edit them out of your file name.
 
C

Char Jackson

I can't explain it more lucidly. I simply want
to name the pdf file with a name made up of two
others.
Oh, I get it now. You're only using Notepad as a scratch pad, as a
temporary place to build the concatenated filename. Once built, you
want to use that to rename the downloaded pdf.

Well, in that case, you need to edit out the illegal characters.
That's easy for me to say, but might be harder for you to do since it
might disrupt the meaning or sensibility of what you're trying to
accomplish. At any rate, that's what you have to do. Change slashes to
underscores, for example, or vertical bars to dashes. Change every
illegal character to a legal character.

On my Win 7 system, when I attempt to use an illegal character,
Windows gives me a short list of illegal characters. If yours is the
same, you can see what you need to remove. If you're already doing all
of that and still having this problem, type your filename from
scratch. Do it in Notepad, on the line directly below where you've
pasted the two pieces. Use that to rename your pdf. That way, if
there's some control character or escape code included that Windows
can't display, it won't be included in the name that you type.
 
R

Rob

I can't explain it more lucidly. I simply want
to name the pdf file with a name made up of two
others.

Ah maybe the PDF is locked and you can't change the name.
 
C

Char Jackson

Ah maybe the PDF is locked and you can't change the name.
I don't think renaming is included in the possible security
restrictions, at least as far as I can see.
 
R

richard

Win7 SP1

I download documents with filenames including * /
\ | % etc.

Before I save these documents I remove the
offending forbidden characters, but Windowws still
refuses to save them.

How can I save them?

Peter
Open adobe and open the original file.
You'll need to use the "file:save as" function and enter the corrected file
name.
Then windows should not get frustrated.
 
R

Rob

Open adobe and open the original file.
You'll need to use the "file:save as" function and enter the corrected file
name.
Then windows should not get frustrated.
Will that happen in reader as well?
 
C

choro

Open adobe and open the original file.
You'll need to use the "file:save as" function and enter the corrected file
name.
Then windows should not get frustrated.
Windows never gets frustrated. It is the USER who gets frustrated" ;-)--
choro
*****
 
P

Peter Jason

Oh, I get it now. You're only using Notepad as a scratch pad, as a
temporary place to build the concatenated filename. Once built, you
want to use that to rename the downloaded pdf.
Yes.


Well, in that case, you need to edit out the illegal characters.
That's easy for me to say, but might be harder for you to do since it
might disrupt the meaning or sensibility of what you're trying to
accomplish. At any rate, that's what you have to do. Change slashes to
underscores, for example, or vertical bars to dashes. Change every
illegal character to a legal character.
I remove all the illegal characters, but still the
"illegal-character error message" appears. Some
illegals may be hidden.

On my Win 7 system, when I attempt to use an illegal character,
Windows gives me a short list of illegal characters. If yours is the
same, you can see what you need to remove. If you're already doing all
of that and still having this problem, type your filename from
scratch. Do it in Notepad, on the line directly below where you've
pasted the two pieces. Use that to rename your pdf. That way, if
there's some control character or escape code included that Windows
can't display, it won't be included in the name that you type.
I'll try again and report back. It all works
when there's a single-word name.
 
P

Peter Jason

I don't know if I understand your description, but my guess would be
that your file name includes tabs or some other invisible whitespace
character other than a plain space. That is not allowed. Type in a
legal file name and save it. Then examine the contents of the file with
a text editor that will display the hex values of the "text", or with a
hex editor (I suggest XVI31,
<http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm>
I bet you will see your problem characters in there. You will have to
edit them out of your file name.
I downloaded & ran it but there were no strange
characters.
 
V

VanguardLH

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.
 
P

Peter Jason

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.
 

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