Este código devuelve el mensaje de error:TypeError: coaccionar a Unicode: String necesidad o tampón
con abierto (infile, modo = 'r', buffering = -1) como in_f, abierto (archivosalida , modo = 'w', buffering = -1) como archivo_sal: TypeError: coaccionar a Unicode: cadena de necesidad o tampón, se encuentra el archivo
# Opens each file to read/modify infile=open('110331_HS1A_1_rtTA.result','r') outfile=open('2.txt','w') import re with open (infile, mode='r', buffering=-1) as in_f, open (outfile, mode='w', buffering=-1) as out_f: f = (i for i in in_f if i.rstrip()) for line in f: _, k = line.split('\t',1) x = re.findall(r'^1..100\t([+-])chr(\d+):(\d+)\.\.(\d+).+$',k) if not x: continue out_f.write(' '.join(x[0]) + '\n')
Por favor, que alguien me ayude.
tan fantástico increíble. ¡Gracias! –