Searching for text files with Unix line endings ? Regular Expression ?

  • Thread starter Thread starter Valerie Duveny
  • Start date Start date
V

Valerie Duveny

Hello,

I would like to search for (text) files with unix line endings on my WinXP system.

As well known line endings under WinXP are implemented as hexadecimal 0D 0A
whereas under Unix/Linux line endings are just reperesented by one hex byte: 0A

When I want to search now recursively in a win dirr tree for all text files which contain unix line endings I must somehow
code the following search pattern:

Search for a byte hex 0A which is NOT preceded by a hex byte 0D
If this exist, then this is a text file with Unix file.

How do I code this with an regular expression?

Val
 
"Valerie Duveny" <gremlin@gmx.net> wrote in message
news:477ca3ee$0$16660$9b4e6d93@newsspool3.arcor-online.net...
> Hello,
>
> I would like to search for (text) files with unix line endings on my WinXP
> system.
>
> As well known line endings under WinXP are implemented as hexadecimal 0D
> 0A
> whereas under Unix/Linux line endings are just reperesented by one hex
> byte: 0A
>
> When I want to search now recursively in a win dirr tree for all text
> files which contain unix line endings I must somehow
> code the following search pattern:
>
> Search for a byte hex 0A which is NOT preceded by a hex byte 0D
> If this exist, then this is a text file with Unix file.
>
> How do I code this with an regular expression?
>
> Val


You need to reconsider your search criteria. While it is true that
a Unix-style text file uses $0a as a line terminator, that same
character will also occur in just about all binary files, e.g. in
..exe, .dll, .doc, .xls files.
 
Re: Searching for text files with Unix line endings ? RegularExpression ?

On 3 jan, 09:59, grem...@gmx.net (Valerie Duveny) wrote:
> Hello,
>
> I would like to search for (text) files with unix line endings on my WinXP system.
>
> As well known line endings under WinXP are implemented as hexadecimal 0D 0A
> whereas under Unix/Linux line endings are just reperesented by one hex byte: 0A
>
> When I want to search now recursively in a win dirr tree for all text files which contain unix line endings I must somehow
> code the following search pattern:
>
> Search for a byte hex 0A which is NOT preceded by a hex byte 0D
> If this exist, then this is a text file with Unix file.
>
> How do I code this with an regular expression?
>
> Val


You need to reconsider your search criteria. While it is true that
a Unix-style text file uses $0a as a line terminator, that same
character will also occur in just about all binary files, e.g. in
..exe, .dll, .doc, .xls files.
 
Back
Top