I have a list of words such as:string1string2string3....string12312How do I convert them these words in such manner that output could be used as a JS array, i.e. String1, String2..., String12312 --- in other words how do I add quotation marks and commas? I understand this an be done in shell, but I guess any other solution would be okay as long as the result can be converted into an array.
Add quotation marks & comma to each word in a file
shell script;text processing
Here's one way:sed 's/^\|$//g' file | paste -d, -sstring1,string2,string3,....,string12312