I gathered Google Ads keywords from several tools and the list is full of blank lines; how do I remove the repeats and the gaps in one go?
In the duplicate-line remover, set 'Empty lines' to 'Remove all empty lines'. In the same pass the repeated keywords and every blank line go, while each keyword stays in the position of its first occurrence, so you get a compact list ready to paste.
Why the list fills up with gaps
Every keyword tool exports in its own way. One puts a blank line between groups, another ends the file with several empty lines, and when you paste the output of three tools one under another you leave a line or two between them to remember where each group came from. The result is a long list with repeats and gaps, and pasting it as it is into the ads editor means cleaning it by hand there.
A worked example
A 7-line list: arabic coffee, a blank line, saudi dates, arabic coffee, two blank lines, cardamom.
With 'Remove all empty lines': 7 input lines, 3 kept, 4 removed, of which 3 were empty. The result: arabic coffee, then saudi dates, then cardamom.
With the default 'Like any line': 4 kept and 3 removed. The first blank line stays in place between arabic coffee and saudi dates, and the other two go.
In this example the difference is one line, but in a list of hundreds of keywords it means a gap somewhere in the middle that you have to hunt for. That is why 'Remove all empty lines' is the right choice for any list that will be pasted into another tool.
Steps
- Open the Duplicate-line remover and paste all the lists together.
- Under 'Empty lines', choose 'Remove all empty lines'.
- Untick 'Case-sensitive matching' if some tools write keywords in capitals.
- Tick 'Ignore spaces at the start and end of a line', since exports sometimes leave spaces behind.
- Copy the result or download it as a text file.
Lines that contain only spaces
A line with nothing but spaces counts as empty too. We tried a list with a line of three spaces between two keywords: it was removed with 'Remove all empty lines', and the note under the summary said one of the removed lines was empty. So these lines need no separate cleaning.
What the tool does not do for keywords
- It does not know that 'arabic coffee' and 'coffee arabic' are the same search; they are two different lines.
- It does not merge singular and plural, or fix spelling.
- It does not strip match-type marks such as square brackets or quotes, so '[arabic coffee]' is a different line from 'arabic coffee'.
- It does not remove double spaces inside a phrase. If there are any, clean the list with the Whitespace cleaner before removing repeats.
After pasting into the ads editor, review the list as usual. The tool removes literal repeats and gaps; which keywords you target is still your call.
Common questions
Does the keyword order change?
No, each keyword stays where it first appeared.
Does it work for Arabic keywords?
Yes, and matching is literal, so make hamza and ta marbuta spellings consistent before pasting.
What line endings does the downloaded file use?
LF line breaks.
