NotepadPlusPlus
Website Visitors:
Contents
Convert vertical words to horizontal with double quotes and comma
If you have content in a line like shown below,
apple banana lemon watermelon
you want to add double quotes and add comma and bring them to a single line.
You won’t be able to do it in a single replacement; you’ll have to perform a few steps. Here’s how I’d do it:
-
Find (in regular expression mode):
1(.+)Replace with:
1"\1"This adds the quotes:
1 2 3 4"apple" "banana" "lemon" "watermelon" -
Find (in extended mode):
1\r\nReplace with (with a space after the comma, not shown):
1,This converts the lines into a comma-separated list:
1"apple", "banana", "lemon", "watermelon"
Your inbox needs more DevOps articles.
Subscribe to get our latest content by email.
