How do i plot only the soil classification and not the additional descriptions on a fence

i.e. Sandy Silt and not any additions like -moist,dense,etc even though it's in the lithology description.

 Hoping to have the layout like this.

Parents
  • You can do this using the current description field as is; provided ALL descriptions are entered using uniform formatting. In the example you provided above, you could search the text string for the position of the first and second bolding marks, then extract the text between them for display on your column. This only works if you always bold the text you want on your column or use some other uniform way (such as all text before the first period) to determine the text to extract. Anything else can be extracted from a long description as well. For example, you could extract the color to control the color of your graphics if it is ALLWAYS the word between the second and third comma. If you are hand entering your descriptions, the probability of a description being written in a different order or using different punctuation/ formatting is high.  A component description model using pick lists for each component reduces this probability. I do not have a computer with gINT available right now but if you want help writing a function to extract the desired text, let me know and I will provide more insight mid next week.

Reply
  • You can do this using the current description field as is; provided ALL descriptions are entered using uniform formatting. In the example you provided above, you could search the text string for the position of the first and second bolding marks, then extract the text between them for display on your column. This only works if you always bold the text you want on your column or use some other uniform way (such as all text before the first period) to determine the text to extract. Anything else can be extracted from a long description as well. For example, you could extract the color to control the color of your graphics if it is ALLWAYS the word between the second and third comma. If you are hand entering your descriptions, the probability of a description being written in a different order or using different punctuation/ formatting is high.  A component description model using pick lists for each component reduces this probability. I do not have a computer with gINT available right now but if you want help writing a function to extract the desired text, let me know and I will provide more insight mid next week.

Children
  • Ok, I worked up a little example to demonstrate how this can easily be done.  My example data is shown in the picture below.  Note that it has a portion of the long description bolded.  I set up various scenarios on the location of the bolding and the contents of the bolding to test how the expression reacts to unexpected conditions.  The description of each scenario is in red to the right.

    I created a text vs depth entity on a typical fence diagram that is set to right justify with block alignment centered vertically using the following text expression:

    <<Remark(Locate position of first bold mark)>>_
    <<Remark(add 5 to location to identify beginning of text)>>_
    <<Remark( to be extracted)>>_
    <<Let(XBegin=_
        <<Calc(<<InStrAtOccurrence(<<LITHOLOGY.Description>>,"<<B>>",1)>>+5)>>_
    )>>_
    <<Remark(Find lposition of second bold mark in description)>>_
    <<Let(XEnd=_
        <<InStrAtOccurrence(<<LITHOLOGY.Description>>,"<<B>>",2)>>_
    )>>_
    <<Remark(Calculate length of string to extract)>>_
    <<Let(XLength=_
        <<Calc(<<Get(XEnd)>>-<<Get(XBegin)>>)>>_
    )>>_
    <<Remark(Extract the desired text from the description string)>>_
    <<Mid(_
        <<LITHOLOGY.Description>>,_
        <<Get(XBegin)>>,_
        <<Get(XLength)>>_
    )>>

    The expression above is much more verbose than necessary and can be shortened significantly.  I included remarks and used let and get variables to enhance understanding. Note that the InStr function will return the beginning position of the 5 character bold mark so it is necessary to add 5 to the returned position to locate the beginning position of the text to be extracted.  Everything else is pretty straight forward.

    The entity creates the following output with the example data above.

    Note that only the text in the long description that is between the bolding marks is printed to the left of the output column.  As expected, if no bolding is found, the expression prints nothing. I did not test what happens if only one bolding mark is found but it would be worth checking. If it does not give you what you expect you can modify the expression to deal with that situation.

    I hope this gives you some insight on how various components of a long description string can be extracted for use in reports or other expressions.  There just has to be a unique and repeatable way of locating the desired component in the long description.

    Any questions please respond to this thread.