• DOCUMENTATION
  • WORKATO BLOG
  • PRODUCT BLOG
  • Return to Workato
  • Log in
  • ☰
  • Community/Discussions
Solution home Recipe 101 Formula Mode Tips and Tricks

Converting File Types: Unix LF and Windows CRLF (or Vice Versa)

Modified on: Wed, Dec 5, 2018 at 7:50 PM

The term CRLF refers to Carriage Return (ASCII 13, \r) Line Feed (ASCII 10, \n).For example: in Windows both a CR and LF are required to note the end of a line, whereas in Linux/UNIX an LF (\n) is only required.


Files can be converted from one to another using the .gsub formula.

If you are converting from Unix LF to Windows CRLF, the formula should be <file content>.gsub("\n","\r\n"). This solution assumes that the file does not yet have the Windows CRLF line endings. You can refer to the following screenshot, where the file is taken from Google Drive:



Conversely, if you would like to convert the file from Windows CRLF to Unix LF, the formula should be <file content>.gsub("\r\n","\n"). This solution assumes that the file does not yet have the Unix LF line endings. You can refer to the following screenshot:


If you still face issues, feel free to leave feedback on this support article or send us an email at support@workato.com.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

Related Articles

    Still can't find your solution?

    Visit our forums to search for answers, or post your own questions.

    Documentation
    Developer's Library
    Tutorials
    eBooks
    Product Hour
    Product Blog
    Workato Blog
    Product updates
    Customer Stories
    © Workato 2020   Privacy   Terms   +1 (844) 469-6752
    • Documentation
    • Workato Blog
    • Product Blog
    • Solutions
    • Forums
    • Tickets
    • Log in
    • Return to Workato