Redis-cli --csv option (exporting to csv)

后端 未结 5 2016
轻奢々
轻奢々 2021-02-02 12:34

I would like to export a subset of my Redis data on the slave to a csv file. I notice a new csv output option was added to redis-cli but I am unable to find documentation of ho

5条回答
  •  攒了一身酷
    2021-02-02 13:06

    If you don't require wrapping the values in quotes as --csv does, then the raw output is sufficient, and you just need to join every 2 lines with a comma to get a CSV:

    redis-cli  | paste -d ","  - - > out.csv
    

提交回复
热议问题