I Have a .csv file with columns like these
ID | Valuue1 | Value2 | Value3 |
---|---|---|---|
1 | A | B | C |
I'm trying to insert those values in redis where ID will be the KEY and the value will be a string like this
"{\"Value1\":\"A\",\"Value2\":\"B\",\"Value3\":\"C\"}"
The idea is that from my API I can fetch an ID and use the value as string format or Json ,I tried different ways including the following but I'm not able to get the desired result
tail -n +2 dnis.csv | awk -F',' '{print "SET \""$1"\" \""Value $1 Value2 "$2" Value3 "$3""\""}'| redis-cli pipeline
Any idea? Thanks