Re: Parsing a semi-strange line of text...

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Torgeir Bakken (MVP) (Torgeir.Bakken-spam_at_hydro.com)
Date: 02/18/04


Date: Wed, 18 Feb 2004 21:39:14 +0100

Anthony B wrote:

> I have a text file... with spaces in strange spots that I need parsed... can I have some help? I've tried parsing at the 'space' but that doesn't work due to white spaces sometimes being 2 characters long... (two spaces) only on some lines ..etc... (Can I trim multiple whitespaces down to a SEMI-COLON??)

Hi

Removing all double spaces in the text in the variable TheLineOfText
is maybe an option, like this:

  TheLineOfText = objTextFile.Readline
  ' remove all double spaces (easier to use Split later on)
  Do Until InStr(TheLineOfText, " ") = 0
    TheLineOfText = Replace(TheLineOfText, " ", " ")
  Loop

--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter


Relevant Pages

  • Re: ODBC - system dsn remote setup
    ... If you search for something like Windows Scripting Registry you should find ... plenty. ... There's an MS Scripting centre and a very good newsgroup, ... "Anthony" wrote: ...
    (microsoft.public.windows.server.general)
  • RE: Worms and CScript/WScript
    ... > Incidents" actually recommends disabling Windows Scripting Host by removing ... up-to-date with security patches -- used to and presumably still does ...
    (Incidents)
  • Re: SP2 Installation Error 800710D9
    ... Anthony wrote: ... I have created a batch file that might help out on this problem. ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.windowsupdate)
  • Re: Xp home Cant login after spyware removal??
    ... Unable to Log On To Windows XP After Removing wsaupdater.exe ... Blazefind problem ... -- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.windowsxp.general)