Re: Parsing a mostly fixed width text file

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



Rick,

Thanks. I will definitely utilize that optional argument.

"Rick Rothstein [MVP - Visual Basic]" <rickNOSPAMnews@xxxxxxxxxxxxxxxxx>
wrote in message news:%23IrDhL0%23FHA.4088@xxxxxxxxxxxxxxxxxxxxxxx
>> The delimiter is a space, the problem is that will work to create
> the first
>> 3 columns. After that, it's a memo field that tends to get broken
> apart
>> because of the spaces. I would need a way to create the first three
>> columns. The last character of the third field should always be an
> ending
>> square bracket.
>>
>> ***START SAMPLE***
>> 2005-11-28 12:30:49.812 [pid=0x27c,tid=0x4a0] Entering
>> ProcessGroupPolicyExDrives()
>> 2005-11-28 12:30:49.828 [pid=0x27c,tid=0x4c0] Set thread desktop.
>> 2005-11-28 12:30:49.828 [pid=0x27c,tid=0x4c0]
>> SOFTWARE\Policies\Microsoft\Windows\Group
>> Policy\{1EA5E892-2292-438F-8D05-40E7B0007585}
>> 2005-11-28 12:30:49.828 [pid=0x27c,tid=0x4c0]
> BackgroundPriorityLevel ( 0 )
>> 2005-11-28 12:30:49.843 [pid=0x27c,tid=0x4c0] LogLevel ( 3 )
>
> Perhaps the Split function could be of use on a line-by-line basis.
> Using that last line as an example...
>
> Txt = "2005-11-28 12:30:49.843 [pid=0x27c,tid=0x4c0] LogLevel ( 3 )"
> Field = Split(Txt, " ", 4)
> Debug.Print Field(0)
> Debug.Print Field(1)
> Debug.Print Field(2)
> Debug.Print Field(3)
>
> Notice that indexes 0, 1 and 2 of the Field array contain the first
> three columns of information and index number 3 of the array contains
> the entire rest of the line (that is, the entire comment column). This
> "lumping" of the rest of the line into index number 3 is due to my use
> of the 3rd (normally optional) argument in the Split function. If you
> don't care about the comment text, you can leave out that optional
> argument and just ignore any indexes greater that 2.
>
> Rick
>
>


.



Relevant Pages

  • Re: Parsing a mostly fixed width text file
    ... > The delimiter is a space, the problem is that will work to create ... it's a memo field that tends to get broken ... Perhaps the Split function could be of use on a line-by-line basis. ...
    (microsoft.public.vb.general.discussion)
  • Re: Not the usual memo truncating issues
    ... >>I've got HTML code in the memo-field. ... >>and delimiter that is available, ... >>> I've just put 60,000 characters into a memo field in a table in a test ... > John Nurick ...
    (microsoft.public.access.externaldata)
  • Re: Importing text files saved from word forms
    ... the Split function (once for each delimiter) to break the row into the ... Dim strFile As String ... Any way to import many text files into either Excel or Access? ...
    (microsoft.public.access.externaldata)
  • Re: Importing text files saved from word forms
    ... the Split function (once for each delimiter) to break the row into the ... Dim strFile As String ... Doug Steele, Microsoft Access MVP ...
    (microsoft.public.access.externaldata)
  • Re: Identify Delimiters
    ... use the split function to find out if it has the right amount ... delimiter used in this text file.Some days it is tab or other days it ... uses semi-colonas a delimiter. ... So in my line input code I use both the codes and commenting either ...
    (comp.databases.ms-access)