[NTLUG:Discuss] How to write converted file format from vi?
Hank Ivy
hankivy at hot.rr.com
Thu May 6 21:01:50 CDT 2010
On Thursday 06 May 2010 05:25 pm Neil Aggarwal wrote:
> Hello:
>
> I received a CSV file from a data provider, but it has
> a lot of non-printing characters in it. Here is what
> the first part of the file looks like when I do a head
> on it:
>
> --" 5 " , " 5 0 0 9 0 " , " R 1 0 0 0 0 0 " , " 5 9 1 0 - 0 4 - 0
>
> When I open the file in vi, it displays as normal text:
>
> "5","50090","R100000","5910-04-0
>
> The bottom of the vi window states this:
> "t.csv" [converted] 934393L, 181540523C
>
> So, vi did some kind of conversion on it.
>
> I want to write the converted version of the file
> out to a new file, so I tried
>
> :w /tmp/test2.txt
>
> but the new file still has the non-printing characters.
>
> Is there a way to tell vi to write the version of the file
> it converted?
>
> Thanks,
> Neil
What exactly is in the file?
Show us the results from:
head -3 t.csv | od -ch
This will show us the exact values of the special characters and the end of
line delimiters that are in the file.
--
Hank Ivy
GPG Fingerprint:
1A0F E1CB 0160 0069 7C19 4B00 911C 92E8 F8B0 4C7C
More information about the Discuss
mailing list