Write Delimited Texts in Text File

Verb: textWriteDelimited

Available from: <Standard>

Writes a list of texts separated by a delimiter to a text file.

Syntax

textWriteDelimited --texts(List<String>) --delimiter(TextDelimiterOption) --characters(String) --lengths(List<Numeric>) --file(TextFileWriter)

Inputs

Script Designer Required AcceptedTypes Description
--texts Texts Required List<Text> Texts used for writing to the file, separated by the chosen separator.
--delimiter Delimiter type Required TextDelimiterOption Option for selecting the delimiter type used. The available delimiters are:
  • By Characters
  • By Length
  • --characters Separator Only whenDelimiter type is ByCharacters Text Character used as a separator in the text between each text list element.
    --lengths Lengths Only whenDelimiter type is ByLengths List<Number>, Text Lengths of characters of each part of the final text. They might be expressed as a list of numbers or a sequence with numbers separated by commas "1,2,3".
    --file Text writer Required Text File Writer Variable that holds the opened text file.

    Example

    Writes a list of texts, separated by a character delimiter, to an open text file for writing. The Open Text File for Writing command is used to open the file and the Write Delimited Texts in Text File command is used to write.

    defVar --name textsList --type List --innertype String --value "[IBM,Automation,RPA,RDA]"
    defVar --name filePath --type String
    defVar --name textWriter --type TextFileWriter
    getSpecialFolder --folder "Desktop" filePath=value
    // Open the file informed for reading.
    openTextWriter --mode "OpenOrCreate" --autoflush  --share "Write" --path "${filePath}\\textFile.txt" --encoding "Default" textWriter=value
    // Write the entered text list into the open file, separated by the delimiter "-".
    textWriteDelimited --texts ${textsList} --delimiter "ByCharacters" --characters "-" --file ${textWriter}
    // The example returns the following result within the file:
    //IBM-Automation-RPA-RDA
    

    See Also

  • Binary Read Int
  • Close Binary File
  • Close Text File
  • Get Binary File Boolean
  • Get Binary File Characters
  • Get Binary File Text
  • Get Date and Time in Binary
  • Get Table from a Text File
  • Get Text File Line
  • Go to Text Reader Line
  • Move Index in Binary File
  • Open Binary File for Reading
  • Open Binary File for Writing
  • Open Text File for Reading
  • Open Text File for Writing
  • Read Binary File Decimal
  • Read Binary File Time Span
  • Read Delimited Line of Text File
  • Read Text to the End
  • Save Changes to Binary File
  • Save Changes to Text File
  • Write Boolean in Binary File
  • Write Date Time in Binary File
  • Write Decimal to Binary File
  • Write Delimited Text Line to Text File
  • Write in Text File
  • Write Integer to Binary File
  • Write Text in Binary File
  • Write Text Line to Text File
  • Write Time Span in Binary File