0

count lines of text

Formula to count the lines of text in a text field?

e.g.

  • April is the cruellest month, breeding
  • Lilacs out of the dead land, mixing
  • Memory and desire, stirring
  • Dull roots with spring rain.

 to yield 4                                          

2 replies

null
    • John_Halls
    • 11 mths ago
    • Reported - view

    Try this

    let a := YourTextField;
    let b := "
    ";
    let c := split(a,b);
    count(c)
    

    It is putting each line of text into an array (ignoring empty lines) which you can then count.

    Regards John

    • musprats
    • 11 mths ago
    • Reported - view

    Thank you John, perfect!

    Nice lesson for me on the use of 'split', and of the subtle distinction between

    " " space

    as opposed to 

    "

    " return

    (obvious once you know)

    Peace,  Sandy

Content aside

  • Status Answered
  • 11 mths agoLast active
  • 2Replies
  • 54Views
  • 2 Following