A-PDF :: Affordable PDF Tools

How to remove blank spaces or part of a PDF file name?

Return KB main page

Question

I have to rename hundreds of pdf files monthly, can your program help me to easily remove blank spaces or part of a PDF file name?

Solution

You can use "Advanced" script feature in A-PDF Rename (free download here) to remove blanks spaces or characters from PDF files names with ease:

  1. Start the program, click "File->Add PDF Document" or "File->Add Folder" to add PDFs to the file list;
  2. Choose "Advanced" Rename Method, then input script in box, use the "abc def ghij" as example:

    A. Delete blank spaces, use below script:

    Begin
    newFilename := AnsiReplaceStr(Filename, ' ', '');
    End.

    B. Delete part " def", use script below:

    Var
    p :Integer;
    Begin
    p := Pos('' def '', Filename);
    if p > 0 then
    newFilename := LeftStr(Filename, p - 1) + RightStr(Filename, Pos(ReverseString('' def ''), ReverseString(Filename)) - 1);
    End.;

  3. Run the script and preview the effect of renaming in the list, then click "Rename" button to rename all listed files.

Related products

  • A-PDF Rename - batch rename multiple PDF document based on content, metadata and file attributes(Size, Datetime) within PDF files. You can batch change or update multiple PDF files metadata (title, creator, producer, author, subject and keywords) as well as
  • A-PDF Preview and Rename - Preview PDF content easily, rename PDF based on content you previewed.
  • A-PDF Preview and Move - Preview content for multiple PDF files, then OCR page content to rename and define dest folder to move.

We always like improving our products based on your suggestions. Please send your feedback (or ask questions) to us in the contact page.

Return KB main page