Answer the question
In order to leave comments, you need to log in
How to properly split a string in python?
Good afternoon. What is the correct way to split such a string in Python into an array of data?
(726928131,'Данные','3-и Данные (111), данные','9',NULL,NULL,NULL,NULL,1,'Данные, Данные, Данные', 9,NULL,NULL,2545580,1)
Answer the question
In order to leave comments, you need to log in
Do not use regular expressions where they are not needed. Your string is a normal CSV.
import csv
scsv = '''726928131,'Данные','3-и Данные (111), данные','9',NULL,NULL,NULL,NULL,1,'Данные, Данные, Данные', 9,NULL,NULL,2545580,1'''
row = next(csv.reader([scsv], delimiter=','))
print(row)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question