Multiple delimiters in single CSV file

Sticking with the standard library, re.split() can split a line at any of these characters: import re with open(file_name) as fobj: for line in fobj: line_data = re.split(‘Delim_first|Delim_second|[|]’, line) print(line_data) This will split at the delimiters |, Delim_first, and Delim_second. Or with pandas: import pandas as pd df = pd.read_csv(‘multi_delim.csv’, sep=’Delim_first|Delim_second|[|]’, engine=”python”, header=None) Result:

MySQL delimiter syntax error

DELIMITER is not a MySQL command. It’s a command that your MySQL client needs to support. I was running PHPMyAdmin 2.8.2.4, which didn’t support it. When I upgraded to the newest version, which is currently 3.4.9, it worked just fine. Your MySQL version has nothing to do with DELIMITER and whether it’s supported or not. … Read more