You might also want to open your output file for writing.
In reply to Re: about separator by chromatic in thread about separator by agustina_s