Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.scripting.vbscript > #12417

Re: EOL type detection

From "R.Wieser" <address@not.available>
Newsgroups microsoft.public.scripting.vbscript
Subject Re: EOL type detection
Date 2022-03-05 15:49 +0100
Organization Aioe.org NNTP Server
Message-ID <svvt9e$v97$1@gioia.aioe.org> (permalink)
References <bb79q57z2c92.16pyyy6q0tjfm.dlg@40tude.net>

Show all headers | View raw


JJ,

> Currently ... it's a bit tedious. So, it there a simpler method.

Yes, but it comes at a cost :

[code]
  set oFile = oFS.OpenTextfile(sFile)
    sData = oFile.ReadAll
  oFile.Close

  p1=instr(sData,vbCR)
  p2=instr(sData,vbLF)
[/code]

Now all you have to do is to compare p1 and p2 to get the types.

Apart from "malformed" files (mixing different EOLs) VBScript only seems to 
have a problem with CR-only EOL's (reads everything as a single line).

Regards,
Rudy Wieser

Back to microsoft.public.scripting.vbscript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

EOL type detection JJ <jj4public@gmail.com> - 2022-03-05 15:39 +0700
  Re: EOL type detection "Mayayana" <mayayana@invalid.nospam> - 2022-03-05 08:57 -0500
    Re: EOL type detection JJ <jj4public@gmail.com> - 2022-03-06 06:27 +0700
  Re: EOL type detection "R.Wieser" <address@not.available> - 2022-03-05 15:49 +0100
    Re: EOL type detection JJ <jj4public@gmail.com> - 2022-03-06 06:28 +0700
      Re: EOL type detection "R.Wieser" <address@not.available> - 2022-03-06 10:06 +0100
        Re: EOL type detection JJ <jj4public@gmail.com> - 2022-03-08 05:36 +0700
          Re: EOL type detection "R.Wieser" <address@not.available> - 2022-03-08 11:03 +0100
            Re: EOL type detection JJ <jj4public@gmail.com> - 2022-03-09 09:30 +0700

csiph-web