-
-
Notifications
You must be signed in to change notification settings - Fork 131
Replace Lines mode in write file ignores empty lines. #3461
Copy link
Copy link
Open
Description
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
- Create a .txt file with empty lines interspersed between lines with content. Something like this:
test
test
test
test
test
- 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.
- 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.
- Replace the file with the original content again.
- Use the same write file effect, but now replace any line between 6-9.
- 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)
Reactions are currently unavailable