I have an SSIS package that performs the following.
;
delimited, and \n
for new lines)The problem is that when the file shows up on my Solaris box, it has the following at the start of the file.
\377\376
I have tried dos2unix, and it still has not corrected the issue. In fact, it changes the \377\376 to \227\226, not very helpful.
Is there a way to remove these characters from my file? When they are there, they mess with grep and other Unix tools, like head.
By default, any SSIS or Windows-encoded file is UCS-2-LITTLE-ENDIAN encoded. The easiest way is to encode the file on your Unix server with the following commands.
Switch over to UTF-8 (or whatever encoding you need) with iconv:
iconv -f UCS-2-LITTLE-EDIAN -t UTF-8 input > output
Remove the carriage returns that Microsoft adds to the end of lines.
unix2dos -ascii utf-8-file outputfile