[NTLUG:Discuss] How to write converted file format from vi?

Chris Cox cjcox at acm.org
Thu May 6 17:50:55 CDT 2010


On Thu, 2010-05-06 at 17:25 -0500, 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?

Curious about the hidden chars (od, hexdump, etc).... but
have you tried using vi -v ??
(no guarantees)





More information about the Discuss mailing list