AnsweredAssumed Answered

How to extract lines from a paragraph, without breaking or cutting the words

Question asked by Shakib on May 20, 2018
Latest reply on May 22, 2018 by philmodjunk

Hi,

I have 2 questions about a script that can create multiple records in a child table out of a long text (i.e. “Participant::Text of transcription”) in a parent table, where the records are each a single line of that transcript (line numbers should be added in a separate field too). Here is my relationship graph and the script, and then you can see my questions.

[Note: "_XLineMaking" is a global field.]

Screen Shot 2018-05-20 at 09.48.58 AM.pngScreen Shot 2018-05-20 at 09.32.30 AM.png

 

  1. The first issue is that I need exact number of characters, not words, as basis of the length of the line to be exported into record. The records should have a specific number of characters (i.e. the script should cut the first x number of characters and then export them to a record and so on), however, no words should be cut in half (i.e. we don't want the text in each record to have a "half-word" at the end or beginning of the line). And also if if there is a carriage at the end of the paragraph, the script should be able to keep that carriages (i.e. the last record that contains the last line of the paragraph, might have only a few characters, because there is carriage -enter- at the end of paragraph).
  2. For each record in the child table (where each record contains a single line of the text), there should also be a separate “line number” field. However, the “Set Field [ Lines::Line number; Lines::Line number +1 ]” does not work properly (i.e. it would not go high in 1 increments: 1, 2, 3,,... . It would only return "1" for all the records)

 

Any help is much appreciated.

Outcomes