python opens text file with a space between every character

前端 未结 8 1605
野性不改
野性不改 2021-02-18 17:27

Whenever I try to open a .csv file with the python command fread = open(\'input.csv\', \'r\') it always opens the file with spaces between every single character.

8条回答
  •  臣服心动
    2021-02-18 17:58

    Here's the quick and easy way, esp if python won't parse the input correctly

    sed 's/ \(.\)/\1/g'
    

提交回复
热议问题