Windows wildcards problem workaround #39

Closed
opened 2021-04-25 19:58:00 +00:00 by josch · 0 comments
Owner

By Tim on 2017-11-28T11:08:54.579Z

I know this is very primitive yet I tried this on >300 pages and it works like a charm.

  1. Run cmd
  2. Cd to the folder with images. For this workaround, let's say this folder is "D:\images"
  3. Run "dir /B /ON > list.txt"
  4. Cut list.txt and paste it to some other safe place
  5. Now you need a notepad that supports esc-sequences. I prefer Akelpad. Open the file, then open the replace prompt
  6. Replace "\n" with " %path%" where %path% is the path to the images (in our case, it is "D:/images"). Use "/" instead of "" so you do not make the notepad program think these are some esc-sequences.
  7. Not sure if that's important, but now turn the esc-sequences off and replace all "/" with "" . I'm quite sure this is not really necessary, but just in case
  8. There is still a small problem with the list. Cut the very last path (which is gonna be just a path without the image name at the end) and append it to the first path (which is gonna be just the image name without the path)
  9. Save the file (CTRL+S)

Congratulations! Now you can use the newly-created file list to pass the images' names to the program. Again, works just fine with big quantities of files.


By josch on 2017-11-28T11:10:37.673Z


Okay, but what is the issue with img2pdf that you would like to report?


By Tim on 2017-11-28T11:15:01.040Z


It's not an issue really, it's more of the information to the other users can know how to tackle a problem. If you wish, I can fork the git, update the readme (so people would know) and create a merge request.

By the way, I use the newest python 3.6.3 and the issue still persists.


By josch on 2017-11-28T11:24:14.574Z


The "issue" you speak of is not with img2pdf but with limitations of cmd.exe. The fact that cmd.exe doesn't support wildcards in command line arguments is not a problem with img2pdf. If you want wildcard support, then you should use a shell that supports wildcards. It's not the task of img2pdf to fix the limitations of your shell.


By josch on 2018-03-24T16:34:30.950Z


Status changed to closed

*By Tim on 2017-11-28T11:08:54.579Z* I know this is very primitive yet I tried this on >300 pages and it works like a charm. 1. Run cmd 2. Cd to the folder with images. For this workaround, let's say this folder is "D:\images\" 3. Run "dir /B /ON > list.txt" 4. Cut list.txt and paste it to some other safe place 5. Now you need a notepad that supports esc-sequences. I prefer Akelpad. Open the file, then open the replace prompt 6. Replace "\n" with " %path%" where %path% is the path to the images (in our case, it is "D:/images"). Use "/" instead of "\" so you do not make the notepad program think these are some esc-sequences. 7. Not sure if that's important, but now turn the esc-sequences off and replace all "/" with "\" . I'm quite sure this is not really necessary, but just in case 8. There is still a small problem with the list. Cut the very last path (which is gonna be just a path without the image name at the end) and append it to the first path (which is gonna be just the image name without the path) 9. Save the file (CTRL+S) Congratulations! Now you can use the newly-created file list to pass the images' names to the program. Again, works just fine with big quantities of files. --- *By josch on 2017-11-28T11:10:37.673Z* --- Okay, but what is the issue with img2pdf that you would like to report? --- *By Tim on 2017-11-28T11:15:01.040Z* --- It's not an issue really, it's more of the information to the other users can know how to tackle a problem. If you wish, I can fork the git, update the readme (so people would know) and create a merge request. By the way, I use the newest python 3.6.3 and the issue still persists. --- *By josch on 2017-11-28T11:24:14.574Z* --- The "issue" you speak of is not with img2pdf but with limitations of cmd.exe. The fact that cmd.exe doesn't support wildcards in command line arguments is not a problem with img2pdf. If you want wildcard support, then you should use a shell that supports wildcards. It's not the task of img2pdf to fix the limitations of your shell. --- *By josch on 2018-03-24T16:34:30.950Z* --- Status changed to closed
josch closed this issue 2021-04-25 19:58:01 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: josch/img2pdf#39
No description provided.