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 said:
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.
 
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