I am working on a project where I have to convert a list of 200+ city names from an Excel sheet into a coding format like ["City1", "City2", "City3"]. Adding those double quotes and commas to every single word is taking hours. I tried using some online tools but they are too complicated.
How to format a long list into a JSON Array?
Verified
I am working on a project where I have to convert a list of 200+ city names from an Excel sheet into a coding format like ["City1"...
Comments (3)
How to format a long list into a JSON Array?
1. Input: Paste your city names (one per line).
2. Join with: Select Comma ( , ).
3. Add Prefix: Type " (double quote).
4. Add Suffix: Type " (double quote).
5. Switches: Make sure Trim spaces from items is ON.
After clicking Join Text, your output will look like this:
"Mumbai","Delhi","Bangalore","Pune"
You just need to add the square brackets [ and ] at the very start and end.
There is a toggle called Remove duplicate items. I turn that ON, the tool will automatically check your whole list and keep only one copy of each name.
Here is a quick example of how it cleans the data:
Input:
@user1
@user2
@user1
@user3
Settings: Remove duplicates ON, Separator: Space.
Output:
@user1 @user2 @user3