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
    • 1 yr 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
    • 1 yr 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
  • 1 yr agoLast active
  • 2Replies
  • 56Views
  • 2 Following