ANS-1204 · SUITESCRIPT DEVELOPMENT
Why Are New Lines Not Appearing in NetSuite Text Files?
Understand how different operating systems handle new line characters to ensure proper formatting in NetSuite-generated text files.
Short answer
New line characters vary by operating system. For Windows, use `rn` to ensure proper line breaks in text files, as `n` alone may not render correctly. Unix/Mac OS X typically uses `n`, while older Mac OS versions used `r`. Confirming the target system's expected line break sequence is crucial for consistent file formatting.
Scenario
Users may encounter issues where new line characters in text files generated or processed within NetSuite do not render correctly. This often manifests as text appearing on a single continuous line instead of being broken into separate lines. The problem can be inconsistent, with the same file displaying correctly on one Windows machine but not on another, highlighting a dependency on system settings.
Solution
New line characters are dependent on the system settings and operating systems. It is possible for a file to have the correct line breaks on one Windows 10 machine, but display no line breaks (or n strings) on a different Windows 10 machine. To ensure new lines function as expected, it is essential to use the correct character sequence for the target operating system.
For Windows, if n does not work, use rn to create the new line.
The standard new line character sequences are:
r= CR (Carriage Return) → Used as a new line character in Mac OS before Xn= LF (Line Feed) → Used as a new line character in Unix/Mac OS Xrn= CR + LF → Used as a new line character in Windows
Expert NetSuite Support
Need help with this NetSuite issue?
SuiteScript Development consulting and configuration support
