I have following code to read the txt file as CSV
validationColumns='column1|column2'
headerColumns = validationColumns.split("|")
rawData = subprocess.check_output( 'sshpass -p \'pass\' ssh -o StrictHostKeyChecking=no user tail -n +1 /var/prod/archive/new.txt | awk \'NR==1, NR==35\'', shell=True).decode('utf-8')
df = pd.read_csv(io.BytesIO(rawData), encoding='utf8', sep='|', usecols=headerColumns, quotechar="~")
But I got the error like bytes-like object is required, not 'str' . Can anyone please help me with it.