Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] weird file format





On Thu, 27 Mar 2003 17:11:36 +0900
Brett Robson <b-robson@example.com> wrote:
Subject: [tlug] weird file format
> 
> I've just some html files with weird line delimiters just carriage
> return (hex 0d), no line feed. This stuff has come from a Web "Design"
> company, is that perhaps the Mac file format? 
> 
> You can probably guess what grep, vi and sed think about these files.
> 
> sed won't pick up CRs, can someone suggest a way of turning these long
> haired hippy files into good old unix format?
> 

If you can 'see' them in vi, you should be able to replace them.  
If you're seeing ^Ms stuck in the middle of the line, the (ex) command is completely unintuitive:

:1,$ s/^V^M/^V^M/g

Type that as :1,$ s/<control-V control-M>/<control-V control-M>/g

Yes, it looks like you're substituting in the same character.  Yes, it's strange.  But it usually works.

(If you're not seeing ^M, play around with the first part of the substitution.)

If you need to use it in a script, do it with ex.

Cheers,
Jim



> Brett
> 
> 
> 
> 
> 
> **********************************************************
> TLUG server is hosted by Open Source Development Lab Japan
> http://www.osdl.jp/
> **********************************************************
> 
> ==========================================================
> To unsubscribe from this mailing list, 
> please see instructions at <http://www.tlug.jp/list.html>
> ==========================================================
> 
> 


-- 

----------------------------------------------------------------------
Jim O'Connell
Global Dining System Support
jim at global-dining dot co dot jp
----------------------------------------------------------------------
Key fingerprint = 8EE8 44E0 320A 4718 C76B  AD5F 91EB B996 EB45 F83B
gpg --keyserver pgp.mit.edu --recv-keys EB45F83B 
----------------------------------------------------------------------


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links