What input and output formats does ArrayCat support?
Updated
ArrayCat accepts a list of data as text and converts it into one of several array formats. You can paste text directly or load a file, choose an input format that matches how your data is separated, pick an output format, and optionally apply transformations such as sorting or removing duplicates. It fits cases where you have a flat list of items — one value per line, or values separated by commas or tabs — and need it as a JavaScript, PHP, Python, Go, Delphi, or Pascal array, or as a SQL insert statement.
Input formats
ArrayCat's input data format options are:
- One item per row — each line is a separate element.
- Comma separated — values split on commas.
- Inside quotation marks — values wrapped in quotes.
- Tab separated — values split on tabs.
You can either paste your data into the input area or use the Load file option to bring in a file such as a CSV. The page notes a maximum row length, so very long single rows may need to be split before conversion.
Output formats
After conversion, you can produce:
- Delphi array
- Go array
- JavaScript array
- Pascal array
- PHP array
- Python array
- SQL insert — the site notes this is "technically not an array, but cats get confused sometimes."
The result can be copied to your clipboard.
Transformations you can apply
ArrayCat also supports transformations on the list before or during conversion:
- Sort elements
- Remove duplicate elements
- Count duplicate elements
- Remove empty elements
- Remove trailing separators
- Convert to lower case
- Base64 encode elements
- Convert to HTML entities
- Remove diacritics
- Fix apostrophes
- Fix quotation marks
- Strip excess whitespace
- Unify whitespace
- Trim whitespace
How to choose
| Your situation | Input format to pick | Output format to pick |
|---|---|---|
| CSV file with one record per line | One item per row or Comma separated | Whichever language you're targeting |
| Data copied from a spreadsheet column | One item per row | JavaScript, PHP, Python, etc. |
| Values already separated by commas | Comma separated | Any |
| Values separated by tabs | Tab separated | Any |
| Quoted values | Inside quotation marks | Any |
| Need to seed a database | Any | SQL insert |
If your goal is a clean list without repeated entries, apply Remove duplicate elements and Sort elements before copying the output. If you're moving data into a database, the SQL insert output is the relevant choice even though it isn't a literal array.
The site describes ArrayCat as a free tool for converting a list of data or any string into an array.