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.

  • 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.