Paste a list or load a UTF-8 file to create arrays, JSON or MySQL INSERT statements. Your input stays in your browser.
Worked conversion examples
Convert a newline list to a JavaScript array
Suppose you have a list of status labels to use in a form. Paste one label per line, choose One item per row as the input and select JavaScript array as the output. After converting, copy the array into your JavaScript code. ArrayCat quotes each label and escapes characters such as double quotes and backslashes.
Input
draft
published
archived
JavaScript array
["draft", "published", "archived"]
Convert a CSV column to a JSON array
To extract the IDs from a product export, choose Comma separated (CSV) and check First row contains column names. Select Column 1: id and choose JSON array. The result contains one value per data row. The IDs keep their leading zeros even when JSON type detection is on.
CSV input
id,product
001,"Pencil, blue"
042,Notebook
JSON output
["001", "042"]
Select Column 2: product to extract the names instead. The quotes around "Pencil, blue" keep the comma inside the name.
Read text with a custom separator
Choose Custom separator when the file uses a delimiter such as a pipe or two pipes. For this sample, enter ||, check First row contains column names and select Column 2: label. Choose JSON array for the output. The double quotes keep the two pipes inside red||blue as part of the label.
Delimited input
sku||label
R01||"red||blue"
R02||green
JSON output
["red||blue", "green"]
Count repeated values in a list
To see how often each tag appears, use One item per row for both input and output. Open Transformations and enable Convert to lower case and Count duplicate elements. With Sort alphabetically off, the most frequent values appear first. Lowercasing happens before counting, so Blue and blue are counted together.
Input
Blue
red
blue
Red
blue
Plain text output
3:blue
2:red
Convert a list to MySQL INSERT statements
To prepare a list of names for an existing table, choose One item per row and SQL INSERT (MySQL). Set the table name to products and the column name to name. ArrayCat writes one statement for each output value. It represents the value as UTF-8 hex so characters such as accented letters, quotes and backslashes survive in the SQL.
Input
Café
MySQL statement
INSERT IGNORE INTO `products` (`name`) VALUES (CONVERT(X'436166c3a9' USING utf8mb4))
ArrayCat produces SQL text for you to review and run separately. Check the target table and column first. MySQL can skip a row with a duplicate key and turn certain errors into warnings when you use INSERT IGNORE. See the MySQL INSERT reference.
ArrayCat conversion guide
Choose the input format
One item per row. Each line becomes one value. Use this for lists of names or labels where punctuation within a line belongs to the value.
Comma separated (CSV). Use this for comma-delimited exports. A correctly quoted field can contain a comma, a line break or a doubled quotation mark.
Tab separated. Use this for TSV files or copied spreadsheet cells that are separated by tabs.
Inside quotation marks. Extract quoted values from surrounding text. For example, Tags “red” and “blue” gives two values. This mode can read straight or curly quotes.
Custom separator. Enter the character or sequence that divides the fields. The separator can be up to 20 characters long. A semicolon is a valid separator, as are a pipe and a tab.
If each result still contains a whole row of comma-separated or tab-separated text, check the input format. When ArrayCat reports an unclosed quotation mark in a delimited file, check the row number in the error message. Inside a quoted field, write a literal double quote as two double quotes.
For CSV, TSV and custom-delimited input, check First row contains column names when the first row is a header. Pick one named or numbered column to extract it. All columns, in row order produces one flat list by reading across each row. When a selected cell is missing, ArrayCat treats it as an empty value. Turn off Remove empty elements to keep those placeholders.
Clean up, count and sort values
ArrayCat trims the ends of each value and drops empty items by default. Turn off Trim whitespace when a leading or trailing space belongs to the value. Enable Remove diacritics and Convert to lower case when you want values such as Café and cafe to match before deduplication. HTML entity conversion and UTF-8 Base64 encoding also run before duplicate handling.
Use Remove duplicates to keep the first occurrence of each value. Use Count duplicate elements to keep the frequency of each value. If both options are on, counting uses the values before duplicates are removed. Sort alphabetically orders counts by the value’s text. The conversion summary shows how many items came in and went out. Look below the counts for warnings about uneven rows or long values.
Choose JSON value types and output format
JSON keeps every value in double quotes by default. This suits product codes, phone numbers and IDs that must keep their original spelling. The optional type detector can write 42 as a number, true as a boolean and null as a JSON null. It leaves 001, unsafe integers such as 9007199254740993, and numbers that would be rounded as strings. Keep the default when the number of decimal places matters.
For source code, choose a JavaScript or PHP array, a Python list, or a fixed-size Go string array. Delphi and Pascal output is UTF-8 source with a fixed UnicodeString array and needs at least one value. If a CSV field contains a line break, choose JSON or a code array to preserve it as part of that value. A plain list uses line breaks between items.
Maximum row length wraps code and JSON output between values. The width includes quotation marks and escape sequences added to the output. A single long value or declaration stays intact and can exceed the limit. Increase the limit if you need every row to fit.
Export results and reuse settings
Paste text or load a UTF-8 file up to 10 MB. If a file fails to load, export it as UTF-8 text and try again. After converting, use Copy output for pasting or Download output to save a file with the extension for that format. Convert again after editing the input or changing a setting.
Save a preset to reuse formats and transformations for a recurring job, such as turning the same CSV column into JSON. A preset that contains only settings works with whatever text is in the editor when you load it. To remove text saved with a preset, delete the preset, save over it with Include input data in this preset unchecked, or clear the site’s browser storage. Clear data empties the editor and output.