Skip to content

Replace Lines mode in write file ignores empty lines. #3461

@Oshimia

Description

@Oshimia

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When using the Replace mode in the write file effect if there are any empty lines already in the file Firebot will ignore them completely, removing them from the final file and often writing the wrong line as a result.

Expected Behavior

Empty lines present in the original file should also be present in the final output. If the final number of lines in the text file is smaller than the intended replacement line number it won't write anything at all.

Steps To Reproduce

  1. Create a .txt file with empty lines interspersed between lines with content. Something like this:
test

test

test
test


test
  1. Create a write file effect pointed towards that text file, set to replace. Add some text to the replacement text section and the line number to 5.
  2. Press the Test Effect button and check the text file. There will be no empty lines in the file, and the text you entered into the replacement section will be on the final line of the file, line 5.
  3. Replace the file with the original content again.
  4. Use the same write file effect, but now replace any line between 6-9.
  5. Check the file again, all empty lines will be removed, and no content will be written to the file.

Version

5.65.4

What operating system are you using Firebot on?

Windows 11

Relevant log output

Contact Details (Optional)

hxzac@yahoo.co.uk

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions