I have a file that consists of a single line:a,x,b,c,d,e I want to convert this intoa,x,b,x,c,x,d,x,e,xWhich is the easiest way to achieve this? A solution based on Python will be most helpfulAlso supposing that this file is a csv file will python make the work easier?
Replicate a column in a one-line CSV file
text processing;python;csv
Python#!/usr/bin/env pythonfrom sys import stdinfor line in stdin:    parts = line.split(',')    glue = parts.pop(1)    print(',{0},'.format(glue).join(parts) + ',' + glue)