Skip to main content

Revised Question: I want to use file links in org that have spaces in the file names. The 'file://' hyperlink format does not allow spaces in the link. Is there a way to work around this?

Application: I have a directory with several thousand pdf files. All the file names have spaces. Using total Commander I can export a text file have full path information for all the files. I open this in org and use a renamer to add 'file://' to the front of the path information. If there are no spaces in the name, the file link is perfect and I can open the document directly from emacs. I can also add notes I the org file about what is in that document.

For example, I have a path listing like this that I open in an org file:

\Library\March 2015\Gamma Ray Radiation Fundamentals.pdf

I add the file link preface (using a renamer utility):

file://Library\March 2015\Gamma Ray Radiation Fundamentals.pdf

My org file looks something like this:

  • Space Radiation ** Gamma Ray Info
    • file://Library\March 2015\Gamma Ray Radiation Fundamentals.pdf
    • some notes
* Space Radiation
** Gamma Ray Info 
   - file://Library\March 2015\Gamma Ray Radiation Fundamentals.pdf
   - some notes

However the title has spaces so the link stops at the first space. As I have literally thousands of collected papers and books that spaces in the name, adding %20 or even '+' to fill the space is a major task and also makes the linked document title difficult to read especially if you have several lines of such links.

Is there a way to work around this without having to change all the file names to convert or delete the spaces in the file name?

If so, org mode makes a great organizer for large collections of files like I have. It works really well, opening the file for reading.

(Note: I have looked at cliplink.el but I cannot see how I can apply that to a large number of files easily.)

Revised Question: I want to use file links in org that have spaces in the file names. The 'file://' hyperlink format does not allow spaces in the link. Is there a way to work around this?

Application: I have a directory with several thousand pdf files. All the file names have spaces. Using total Commander I can export a text file have full path information for all the files. I open this in org and use a renamer to add 'file://' to the front of the path information. If there are no spaces in the name, the file link is perfect and I can open the document directly from emacs. I can also add notes I the org file about what is in that document.

For example, I have a path listing like this that I open in an org file:

\Library\March 2015\Gamma Ray Radiation Fundamentals.pdf

I add the file link preface (using a renamer utility):

file://Library\March 2015\Gamma Ray Radiation Fundamentals.pdf

My org file looks something like this:

  • Space Radiation ** Gamma Ray Info
    • file://Library\March 2015\Gamma Ray Radiation Fundamentals.pdf
    • some notes

However the title has spaces so the link stops at the first space. As I have literally thousands of collected papers and books that spaces in the name, adding %20 or even '+' to fill the space is a major task and also makes the linked document title difficult to read especially if you have several lines of such links.

Is there a way to work around this without having to change all the file names to convert or delete the spaces in the file name?

If so, org mode makes a great organizer for large collections of files like I have. It works really well, opening the file for reading.

(Note: I have looked at cliplink.el but I cannot see how I can apply that to a large number of files easily.)

My org file looks something like this:

* Space Radiation
** Gamma Ray Info 
   - file://Library\March 2015\Gamma Ray Radiation Fundamentals.pdf
   - some notes

However the title has spaces so the link stops at the first space. As I have literally thousands of collected papers and books that spaces in the name, adding %20 or even '+' to fill the space is a major task and also makes the linked document title difficult to read especially if you have several lines of such links.

Is there a way to work around this without having to change all the file names to convert or delete the spaces in the file name?

Made title more specific, added corresponding tag
Link

How to create Create a file link in EMACsorg-mode that accepts spaces in the text

Post Reopened by PythonNut, programking, nanny, Andrew Swann, zck
Clarifying intent of my question with an example
Source Link
Arjay-El
  • 101
  • 1
  • 3

Revised Question: I want to use file links in org that have spaces in the file names. The 'file://' hyperlink format does not allow spaces in the link. Is there a way to work around this?

Application: I have a directory ofwith several thousand pdf files I want to create. All the file links to from Emacsnames have spaces. Using total Commander I can export a text file listinghave full path information for all the files with full paths. I open this in org and thenuse a renamer to add file'file://' to the beginningfront of each line to form the linkpath information.

The problem is that some of If there are no spaces in the name, the file names have spaces between wordslink is perfect and I can open the document directly from emacs. If I replacecan also add notes I the spaces with %20org file about what is in that document.

For example, Emacs createsI have a properpath listing like this that I open in an org file link:

\Library\March 2015\Gamma Ray Radiation Fundamentals. But that makespdf

I add the file name hard to read in the link especially when I havepreface (using a couple hundred lines ofrenamer utility):

file paths with names://Library\March 2015\Gamma Ray Radiation Fundamentals.pdf

If there areMy org file looks something like this:

  • Space Radiation ** Gamma Ray Info
    • file://Library\March 2015\Gamma Ray Radiation Fundamentals.pdf
    • some notes

However the title has spaces, so the link text is only as far asstops at the first space which,. As I have literally thousands of coursecollected papers and books that spaces in the name, doesn't workadding %20 or even '+' to fill the space is a major task and also makes the linked document title difficult to read especially if you have several lines of such links.

Is there a way to have Emacs accept a spacework around this without having to change all the file names to convert or delete the spaces in the file name and still create a proper link?

If so, org mode makes a great organizer for large collections of files like I have. It works really well, opening the file for reading.

(Note: I have looked at cliplink.el but I cannot see how I can apply that to a large number of files easily.)

I have a directory of pdf files I want to create file links to from Emacs. I export a text file listing all the files with full paths and then add file:// to the beginning of each line to form the link.

The problem is that some of the file names have spaces between words. If I replace the spaces with %20, Emacs creates a proper file link. But that makes the file name hard to read in the link especially when I have a couple hundred lines of file paths with names.

If there are spaces, the link text is only as far as the first space which, of course, doesn't work.

Is there a way to have Emacs accept a space in the file name and still create a proper link?

Revised Question: I want to use file links in org that have spaces in the file names. The 'file://' hyperlink format does not allow spaces in the link. Is there a way to work around this?

Application: I have a directory with several thousand pdf files. All the file names have spaces. Using total Commander I can export a text file have full path information for all the files. I open this in org and use a renamer to add 'file://' to the front of the path information. If there are no spaces in the name, the file link is perfect and I can open the document directly from emacs. I can also add notes I the org file about what is in that document.

For example, I have a path listing like this that I open in an org file:

\Library\March 2015\Gamma Ray Radiation Fundamentals.pdf

I add the file link preface (using a renamer utility):

file://Library\March 2015\Gamma Ray Radiation Fundamentals.pdf

My org file looks something like this:

  • Space Radiation ** Gamma Ray Info
    • file://Library\March 2015\Gamma Ray Radiation Fundamentals.pdf
    • some notes

However the title has spaces so the link stops at the first space. As I have literally thousands of collected papers and books that spaces in the name, adding %20 or even '+' to fill the space is a major task and also makes the linked document title difficult to read especially if you have several lines of such links.

Is there a way to work around this without having to change all the file names to convert or delete the spaces in the file name?

If so, org mode makes a great organizer for large collections of files like I have. It works really well, opening the file for reading.

(Note: I have looked at cliplink.el but I cannot see how I can apply that to a large number of files easily.)

Post Closed as "Needs details or clarity" by Drew, PythonNut, Jordon Biondo, programking, Andrew Swann
Source Link
Arjay-El
  • 101
  • 1
  • 3
Loading