Questions ยท Text Tools ยท 2 min read
How Do I Clean Up Text Copied From a PDF?
Paste into a plain-text editor, join the hard-wrapped lines back into paragraphs, then run Remove Duplicate Lines to strip repeated blank lines and headers that PDFs scatter through copied text. Finish with a word count to confirm nothing was lost.
Why PDFs copy so badly
A PDF describes appearance: these glyphs, at these coordinates. It has no robust concept of "paragraph" for most files, so selection returns visual lines in presentation order. Columns can interleave, footnotes ride along mid-sentence, and every page boundary injects breaks.
Text-based PDFs (where selection works at all) carry an extraction order that usually matches reading order but not always; multi-column layouts are the common exception where copied text comes out shuffled.
When converting beats cleaning
For whole documents, converting the PDF to Word recovers paragraph structure automatically and is faster than manual rejoining. That conversion runs on Filorraโs server, with files deleted immediately after processing, unlike the purely local cleanup steps above.
For excerpts of a few pages, local cleanup wins: paste, rejoin, deduplicate, done, with the text never leaving your machine.
Paste into a plain-text surface
A plain-text editor strips fonts, colours, and layout boxes that rich-text paste carries along invisibly. What remains is pure characters, ready for cleaning.
Rejoin broken lines
PDF line breaks occur wherever the page ran out of width, not at sentence boundaries. Join lines within each paragraph manually or with your editorโs join/reflow command, watching for hyphenated words split across lines ("exam- ple" needs the hyphen removed too).
Remove duplicated lines
Run the duplicate-line remover to collapse repeated blank lines, running headers, and page numbers that appear once per page in the source. Sort-insensitive mode catches headers that vary slightly.
Verify with a count
Check the word count against expectations. A large discrepancy signals accidentally deleted paragraphs; a small one is normal, since headers and page numbers inflated the original.
Worth knowing before you start
- Scanned PDFs contain images of text; selecting yields nothing, and OCR is required before any cleanup applies.
- Keep the source PDF handy while rejoining; ambiguous hyphens (real compound words versus line-break artifacts) need human judgement.
- Tables copied from PDFs rarely clean up well; extracting them as CSV from the source application is more reliable.
Frequently asked questions
- How do I remove line breaks without removing paragraph breaks?
- Work paragraph by paragraph, or temporarily mark paragraph ends with a unique placeholder (like "ยถยถ"), join all remaining breaks, then restore the placeholder as real breaks. Most power-user editors script this in one pass.
- Will the duplicate-line remover touch my list items?
- Only genuinely identical adjacent or repeated lines are removed. Legitimate repeated content such as intentional refrains in lyrics will be collapsed too, so review results when repetition is meaningful.
Related questions
All questions โ- Why Did My Text Turn Into Weird Characters?That garbage is called mojibake: text encoded one way being read another. It is cosmetic damage with a mechanical fix.
- Does Character Count Include Spaces?Usually yes, but it varies by platform. Spaces are characters to nearly every machine, yet some human editors disagree.
- How Many Words Fit on a Standard Page?Roughly 500 single-spaced, 250 double-spaced, assuming 12-point type and normal margins. The honest answer depends on four settings.
- UTC Offsets vs Time Zones: What Is the Difference?Offsets are static numbers; time zones are living histories of rules. Mixing them up is the root of most date bugs.
Related guides
All guides โ- Writing URL Slugs That Help Instead of HurtSlugs are permanent public infrastructure. A few rules at creation time prevent years of redirect regret.
- Choosing Letter Case DeliberatelyCase is a tone-of-voice dial most people turn unconsciously. Four conventions, four habitats, one converter for fixing the mismatches.
- Writing Meta Descriptions That FitThe snippet is your ad in search results. Write it to a measured budget instead of hoping truncation is kind.
- Planning Meetings Across Time Zones Without the GuessworkMost scheduling pain comes from three avoidable mistakes: trusting abbreviations, converting with the wrong date, and ignoring that the meeting lands on someone elseโs tomorrow.
Related reading
All articles โ- Duplicate Lines Are a Data SmellSometimes duplicates are errors; sometimes they are data. Telling them apart is the skill; removing the harmful ones is the easy part.
- Plain Text Is UnderratedFormats from the 1970s still open perfectly. That immortality is not nostalgia; it is architecture.
- Where Word Counts Quietly Shape WritingWord counts are the invisible currency of writing: budgets, prices, and limits all denominated in words. Knowing the exchange rates pays.
- Reading Regex Without FearRegex looks like line noise because it compresses a whole language into punctuation. Learn the eight moves and any pattern becomes parseable.