0

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

JC_Rambo
  • 61
  • 7
  • RedisJSON maybe? https://redis.com/blog/redis-as-a-json-store/ – Mark Setchell Oct 25 '21 at 15:01
  • unfortunately that option doesn't work for me because I have to connect to a remote redis instance, I'm not able to add modules and RedisJson is not installed. – JC_Rambo Oct 26 '21 at 15:53

0 Answers0