My Tool Studio
Text Tools·3 min read

Building Bulk URLs from Lists with Line Prefixes

You've got 200 product slugs in a column and a sitemap request that wants full URLs by end of day. Typing the domain 200 times is out. A spreadsheet formula works, but it means building a throwaway sheet for a one time job. Building bulk URLs from lists is really a single operation, stamping the same text onto the front of every line, and a prefix tool finishes it before the spreadsheet even opens. The identical trick covers SQL values, Markdown lists, and commented out code, because they're all just per line decoration.

Building bulk URLs from lists, one prefix at a time

The whole job is concatenation.

The recipe is short. Paste the slugs into the input, type the scheme, domain, and base path into the Prefix field, and the output pane assembles finished URLs line by line as you type. Add a Suffix in the same pass when every URL needs a trailing slash or a shared campaign tag.

It beats the spreadsheet approach on friction alone: no concatenation formula, no fill down, no exporting back out to text. And unlike a hasty find and replace on line starts, the prefix lands uniformly even when the lines share no common first character.

A worked prefix run: three slugs become three URLs

Watch one batch end to end.

Input, three lines: red-shoes, blue-jacket, green-hat. Prefix: https://shop.example.com/products/ with nothing in the Suffix field. Output: https://shop.example.com/products/red-shoes, then https://shop.example.com/products/blue-jacket, then https://shop.example.com/products/green-hat. Two hundred lines behave identically; the operation doesn't care how long the list runs.

Suffixes stack in the same pass. Set the suffix to a query string like ?utm_source=newsletter and each line comes out as a complete campaign link. The Skip empty lines checkbox, on by default, keeps blank separator lines from being wrapped into URL fragments.

Wrapping lines in quotes for bulk SQL values

From email list to IN clause.

The database version of the same move. Someone hands you a list of email addresses and a query needs them in a WHERE clause. Set the prefix to a single quote and the suffix to a quote followed by a comma, and the list turns into bulk sql values: every address quoted, comma terminated, one per line, ready to drop inside an IN clause.

Wrapping lines in quotes this way leaves two manual checks. The final line carries a trailing comma the query can't accept, so delete that one character before running it. And if the values might themselves contain quote characters, escape them first, because a prefix tool applies text literally and won't do SQL escaping for you.

Prefix and suffix slips that mangle a batch

Check line one before copying line two hundred.

Four small oversights cause most bad batches:

  • Slash arithmetic: a prefix ending in a slash plus a slug starting with one produces a double slash mid URL, and neither produces a broken path. Inspect the first output line before trusting the rest.
  • The trailing comma on SQL lists, which throws a syntax error at the last value if you forget the cleanup.
  • Unchecking Skip empty lines by accident, which welds the prefix and suffix together on every blank line, planting empty quoted strings in the middle of your values.
  • Invisible spaces in the Prefix or Suffix fields: text is applied literally, so one stray trailing space lands in every single line of the batch.

Three more prefix and suffix recipes worth keeping

Same move, different costumes.

Markdown checklists: a prefix of dash, space, open bracket, space, close bracket, space turns any task list into checkable items, and the default dash prefix already builds plain bullet lists. Commenting out code: a prefix of two slashes or a hash disables a whole pasted block in languages without block comments. CSV protection: wrap each line in double quotes so values containing commas survive a spreadsheet import intact.

Every recipe shares one property: the tool never inspects your lines, it just applies identical decoration to each. Anything with a per line boilerplate shape is fair game.

Prefix / Suffix Lines against Find and Replace and Slug Generator

Edges, middles, and upstream.

Prefix / Suffix Lines only ever touches the start and end of lines. To change text in the middle of lines, or to apply changes conditionally, Find and Replace is the right tool, with regex support when things get surgical. Upstream of URL building, the Slug Generator converts raw product names into the url safe slugs this tool then decorates. And when a list arrives riddled with gaps, Remove Empty Lines clears the blanks so you aren't leaning on the skip checkbox at all.

The tidy pipeline for the sitemap request that opened this article: Slug Generator on the raw names, Remove Empty Lines on the paste, the domain prefix applied here, and the finished URLs dropped straight into the ticket.

Try it now

Open Prefix / Suffix Lines

The tool is one click away. No sign up, no upload, no payment.

Open Prefix / Suffix Lines