In the above example, it would appear that:
GetValue ( textField ; 1 ) would return the text: REC0007
GetValue ( textField ; 2 ) would return "Clause 01 of 07"
GetValue ( textfield ; 4 ) would return "Subject is about extracting text" ---> I'm assuming that there are two returns between clause and subject.
Thank you kindly for your answer. Followup Question - before I give your instructions a try are you saying that when using the text funtion: GetValue( text field; 1) and the same for 2 , 3 and so on that FM recognizes a TextValue as one word when between paragraphs? or Returns? ( not sure of the corect terminology ). Also forgot to ask- What would a script need to include to accomplish the desired routine? I assume it will include the loop steps to get each set of values contained in each "clause" then "push" them into the separate portal records (mentioned in the prior post). Each portal record contains the 3 or maybe 4 fields that corespond with the just mention values. Again thank you for you help. This is great.
What you have can be seen as a list of values in a field separated by returns--a frequent occurrence in Filemaker databases as there are number of ways such lists are produced and used.
GetValue extracts all text from the field between those returns. The second parameter specifies which item in the list is being extracted. It does not perceive the text extracted as a single word.
You are correct that you would need a looping script.
If you had these tables and relationships:
Document::__pkDocID = Paragraphs::_fkDocID
this script, performed from a layout based on Paragraphs would parse the data into separate records, skipping blanks:
Set Variable [$Text ; Document::Textfield ]
Set Variable [$DocID ; value: Document::__pkDocID ]
Set Variable [$K ; value: $K + 1 ]
Exit Loop If [ $K > ValueCount ( $Text ) ]
Set Variable [$paragraph ; value: getValue ( $Text ; $K ) ]
If [ Not Isempty ( $Paragraph ) ]
Go to Layout [ "Paragraph" ( Paragraph ) ]
Set Field [ Paragraph::_fkDocID ; $DocID ]
Set Field [ Paragraph::Paragraph ; $Paragraph ]
Go to layout [ original layout ]
This probably isn't exactly the script you need as I think you want to put different blocks of text into different fields of the same related record, but it should serve as a rough outline of what you need to do. Much will depend on how consistently the text in your original document is formatted. The presence of varying numbers of returns between paragraphs, for example, will complicate things if you need to populate different fields of the same record as I suspect that you need to.