parsePipe-function
public python v1 · immutabledef parsePipe(data): """ Parses pipe-separated fields and handles escaped piped. Escape character is backslash. """ ret = [] splitted = data.split("|") for s in splitted: if ret and ret[-1].endswith("\\"): ret[-1] = "%s|%s"%(ret[-1], s) else: ret.append(s) return ret