Using this tool, you can convert various types of lists. For example, you can convert vertical list like this
to horizontal one like this
There are two boxes separated by a button with an arrow on it. The first box is for lists you want to convert (input lists), and it's editable. The second one is for conversion results of these lists (output lists), and it's read-only. A conversion starts by pressing the green button.
There is also a settings panel. You can change a result of a conversion using the following elements on the panel.
A list is basically a set of items separated by one or more characters like commas, dots, colons, etc., including special characters such as \n
(line feed), \r
(carriage return), and \t
(horizontal tab). There is a need to set the right delimiter in order to specify an input list.
For example, this list
,
pear ,
orange ,
banana ,
grapefruithas comma (,
) as a delimiter.
Let's look at another example
,
pear ;
orange ,
banana ;
grapefruitIn this case, delimiter could be comma or semicolon. It's up to you to decide which character to use.
If the element is disabled (when the checkbox on the left is unchecked), then the delimiter will be recognized automatically. In most cases, there is no need to set some delimiters manually.
This delimiter is used for the making of output lists. Here's an example with comma as a delimiter
Input list | apple pear orange banana grapefruit |
---|---|
Output list delimiter | , |
Output list | apple , pear , orange , banana , grapefruit |
And another one with semicolon
Input list | apple pear orange banana grapefruit |
---|---|
Output list delimiter | ; |
Output list | apple ; pear ; orange ; banana ; grapefruit |
If this element is checked, leading and trailing whitespace characters will be removed for each list item. Space, horizontal tab, line feed, carriage return, form feed, and vertical tab are whitespace characters. For example
pear
orange
banana
grapefruit
Here each list item has a tail space. Check Remove leading/trailing whitespace characters for each list item in order to remove these tails
At times, after manipulations with some settings, you might get empty items in output lists
As you can see, the second item of the list is empty, but if you check Remove empty list items, this item will be removed
If this element is checked, all duplicate items will be removed
Input list | apple , pear, orange, banana, grapefruit, apple |
---|---|
Output list delimiter | , |
Remove duplicates | ✓ |
Output list | apple , pear, orange, banana, grapefruit |
Check this element if you want to sort your list
Input list | apple, pear, orange, banana, grapefruit |
---|---|
Output list delimiter | , |
Sort | ✓ |
Output list | apple, banana, grapefruit, orange, pear |
Check this element if you want to shuffle all items of your list randomly.
Let's take a look at following list
Here is list wrap ([
and ]
) and item wrap ((
and )
). In order to remove these wraps, just fill in fields of Remove wraps of input list
Input list | [(apple), (pear), (orange), (banana), (grapefruit)] |
---|---|
Output list delimiter | , |
Remove wraps of input list → List wrap → Head | [ |
Remove wraps of input list → List wrap → Tail | ] |
Remove wraps of input list → Item wrap → Head | ( |
Remove wraps of input list → Item wrap → Tail | ) |
Output list | apple, pear, orange, banana, grapefruit |
If you want to do the same things from the previous paragraph but vice versa, fill in fields of Add wraps to output list
Input list | apple, pear, orange, banana, grapefruit |
---|---|
Output list delimiter | , |
Add wraps to output list → List wrap → Head | [ |
Add wraps to output list → List wrap → Tail | ] |
Add wraps to output list → Item wrap → Head | ( |
Add wraps to output list → Item wrap → Tail | ) |
Output list | [(apple), (pear), (orange), (banana), (grapefruit)] |
In order to replace one text with another, fill in fields of Replace text. All occurrences of search string will be replaced by replacement string (or they will be simply removed if replacement string is empty).
Input list | apple, pear, orange, banana, grapefruit |
---|---|
Output list delimiter | , |
Add wraps to output list → List wrap → Head | var fruits = [ |
Add wraps to output list → List wrap → Tail | ]; |
Add wraps to output list → Item wrap → Head | " |
Add wraps to output list → Item wrap → Tail | " |
Output list | var fruits = ["apple", "pear", "orange", "banana", "grapefruit"]; |
Input list | $fruits = array(1 => "apple", 2 => "pear", 3 => "orange", 4 => "banana", 5 => "grapefruit"); |
---|---|
Input list delimiter | => |
Output list delimiter | : |
Remove leading/trailing whitespace characters for each list item | ✓ |
Remove wraps of input list → List wrap → Head | $fruits = array( |
Remove wraps of input list → List wrap → Tail | ); |
Add wraps to output list → List wrap → Head | fruits = { |
Add wraps to output list → List wrap → Tail | } |
Output list | fruits = {1: "apple", 2: "pear", 3: "orange", 4: "banana", 5: "grapefruit"} |