Specify Line Feeds for Windows while Formatting Documents

In this example, we create a Pipeline that reads CSV data and then formats it for Windows-style line feeds using the CSV Formatter Snap.

Text files created on Windows have different line endings than files created on Linux. Windows uses the carriage return and line feed ("\r\n") as a line ending, while Linux uses just a line feed ("\n").


Example Pipeline

Download this pipeline
Use the CSV Generator Snap to supply CSV documents:
Edit CSV
The raw output from the CSV Formatter Snap is as follows:
Raw output

Notice how the double quotes used in the first line of the input CSV data is escaped in the output document.

The CSV Formatter Snap formats the input data and produces an output in the Windows-style line feeds. We selected the Newline Property with CR+LF to give the line feeds in Windows format. We also leave the Quote character field unchanged as '"'. This tells the Snap that all special characters have to be placed in quotes in the CSV output.

Important: The Newline property enables you to create output that works with the line feeds for Windows. Unless specified, the Snap's output defaults to Linux.

CSV Formatter with New Line
Use the File Writer Snap to create a file using the output. Successful execution of the Pipeline displays the following output:

Downloads

Note: To successfully reuse pipelines:
  1. Download and import the Pipeline into SnapLogic.
  2. Configure Snap accounts as applicable.
  3. Provide Pipeline parameters as applicable.