Answer the question
In order to leave comments, you need to log in
How to replace a character in csv in a column?
Your help is urgently needed. Need in a csv file of the form:
2597;2597;; ;"008000000";"";Hager (Deutschland);"Kugeldrehvorrich...";660,09;auf Anfrage;"Maschinen>Vorrichtungen>Ku...";
Answer the question
In order to leave comments, you need to log in
Oh holy saints, in the answers there are some sheets of python code ...
awk 'BEGIN{FS=OFS=";"} {gsub(/\,/, ".", $9)} 1' имяфайла.csv > новыйфайл.csv
Language: python
filename = '' # туты имя файла пишешь
with open(filename, 'r', encoding='utf8') as f:
lines = f.readlines()
newlines = []
for data in lines:
data = data.split(';')
data[8] = data[8].replace(',', '.')
data = ';'.join(data)
newlines.append(data)
with open(filename, 'w') as f:
f.write(newlines)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question