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


Groups > comp.databases.filemaker > #1707

Re: parse

From Helpful Harry <HelpfulHarry@BusyWorking.com>
Newsgroups comp.databases.filemaker
Subject Re: parse
Date 2014-02-01 13:38 +1300
Organization Aioe.org NNTP Server
Message-ID <010220141338417763%HelpfulHarry@BusyWorking.com> (permalink)
References <ca-dnRazMPR8f3bPnZ2dnUVZ_j-dnZ2d@giganews.com>

Show all headers | View raw


In article <ca-dnRazMPR8f3bPnZ2dnUVZ_j-dnZ2d@giganews.com>, ilhalilaz
<ilhalilaz@mail.telepac.pt> wrote:
> 
> how can I pass a block of text with paragraph five fields to return and
> remove the left.
> example
> A proibição de transitar, imposta pelo sinal vertical, de
> forma circular, que se encontra do meu lado direito,
> aplica-se:
>  Aos automóveis de mercadorias e veículos a motor com
> reboque.
>  Aos automóveis de mercadorias e veículos de tracção animal.
>  Aos automóveis pesados e veículos a motor com reboque

I'm not sure I understand this one. I can only see data for four
possible fields: one starting with "A proibi" and three starting with
"Aos autom".

Anyway, all you need to do is look for the carriage return charaters
using the Postition function.

The first field copies all the characters up to the first carriage
return.
e.g.

    Field1 = 
      Left(DataField & "RET"; 
           Position(DataField & "RET";"RET";1;1)-1)

where "RET" should be the carriage return charcter (still inside speech
marks). The extra carriage return appended to the end of DataField in
the functions is to make sure the last lot of data can be found.

The second field copies all the character from the first carriage
return to the second carriage return.
e.g.

   Field2 =
     Middle(DataField & "RET"; 
            Position(DataField & "RET";"RET";1;1) + 1; 
            Position(DataField & "RET";"RET";1;2) 
            - Position(DataField & "RET";"RET";1;1))

The third field copies all the character from the second carriage
return to the third carriage return.
e.g.

   Field3 =
     Middle(DataField & "RET"; 
            Position(DataField & "RET";"RET";1;2) + 1; 
            Position(DataField & "RET";"RET";1;3) 
            - Position(DataField & "RET";"RET";1;2))

The fourth field copies all the character from the third carriage
return to the fourth carriage return.
e.g.

   Field4 =
     Middle(DataField & "RET"; 
            Position(DataField & "RET";"RET";1;3) + 1; 
            Position(DataField & "RET";"RET";1;4) 
            - Position(DataField & "RET";"RET";1;3))

The fifth field (if needed) copies all the character from the fourth
carriage return to the fifth carriage return.
e.g.

   Field5 =
     Middle(DataField & "RET"; 
            Position(DataField & "RET";"RET";1;4) + 1; 
            Position(DataField & "RET";"RET";1;5) 
            - Position(DataField & "RET";"RET";1;4))


Helpful Harry  :o)

Back to comp.databases.filemaker | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

parse ilhalilaz <ilhalilaz@mail.telepac.pt> - 2014-01-31 11:52 -0600
  Re: parse Helpful Harry <HelpfulHarry@BusyWorking.com> - 2014-02-01 13:38 +1300
    Re: parse Howard Schlossberg <howard@nospam.fmprosolutions.com> - 2014-01-31 16:56 -0800
      Re: parse Helpful Harry <HelpfulHarry@BusyWorking.com> - 2014-02-01 14:06 +1300

csiph-web