cat formattedData.txt | redis-cli -h 10.11.0.71 -p 6385 --pipe
#coding=utf-8
import sys
import MySQLdb
outputFile = "formattedData.txt"
delimiter = "\r\n"
for line in result:
row = []
row.append( line['third_id'] )
row.append( line['user_id'] )
data = "*3" + delimiter + "$3" + delimiter + "set" + delimiter + "$" + str(len(row[0])) + delimiter + row[0] + delimiter + "$" + str(len(row[1])) + delimiter
+ row[1] + delimiter + "\r\n"
targetFd.write(data)
targetFd.close()