Answer the question
In order to leave comments, you need to log in
How to create a json string from rows to a column?
You need an email contact database, of the form
email;name
[email protected];Vanya
[email protected];Irina
[{"confirmed":true,"email":"[email protected]","first_name":"\u0412\u0430\u043d\u044f"},{"confirmed":true,"email":"[email protected]","first_name":"\u0418\u0440\u0438\u043d\u0430"}]
Answer the question
In order to leave comments, you need to log in
echo -e "[email protected];Ваня\[email protected];Ирина" | awk -F';' '{print "{\"confirmed\":true,\"email\":\""$1"\",\"first_name\":\""$2"\"},"}' | sed '$ s/.$//' | awk 'BEGIN{print "["} {print} END{print "]"}'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question