Re: Can someone do my job for me? :-)
If it's truly fixed length, with no record separator:
#!/usr/bin/python\n\nbadchar = '\\n'\nreclen = 100\n\ninf = open('/home/anderson/corrupt.txt', 'r')\noutf = open('/home/anderson/fixed.txt', 'w')\n\nwhile 1:\n rec = inf.read(reclen)\n if rec == '': break\n\n if rec[19] == badchar: rec = rec[:19] + ' ' + rec[20:]\n if rec[20] == badchar: rec = rec[:20] + ' ' + rec[21:]\n outf.write(rec)\n\ninf.close()\noutf.close()
Otherwise change the 100 to 101 on UNIX, 102 on Windows. Very rough, but it should get you there.