Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!zen.net.uk!dedekind.zen.co.uk!aioe.org!.POSTED!not-for-mail From: Helpful Harry Newsgroups: comp.databases.filemaker Subject: Re: parse Date: Sat, 01 Feb 2014 13:38:41 +1300 Organization: Aioe.org NNTP Server Lines: 75 Message-ID: <010220141338417763%HelpfulHarry@BusyWorking.com> References: NNTP-Posting-Host: 3Uh51NyBGEJlNEDmCXm98g.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Thoth/1.5.4 (Carbon/OS X) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.databases.filemaker:1707 In article , ilhalilaz 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)