I have a PDF document that I would like to split with each page being a separate file. I’d like to avoid installing anything to do this as I’m trying to keep the command simple for others to just copy/paste into PowerShell.

Would it also be possible to add the split command to the command below? It renames files based on the list of names found in names.txt. There is an equal number of files and names.

$names = cat "\path\to\names.txt"; $i=0; dir | % { ren $_ "$($names[$i]).pdf"}

  • DerisionConsulting@lemmy.ca
    link
    fedilink
    English
    arrow-up
    2
    ·
    8 months ago

    I can’t help you, but there’s an issue with your formatting so the code won’t show. You need the apostrophes on the same line, for the “format as code” things to work.

    $names = cat "\path\to\names.txt"; $i=0; dir | % { ren $_ "$($names[$i]).pdf"}