Differentiate the line feed and carriage return records

I need to differentiate the records of Line feed and Carriage return in CSV file.

For Example:
Test1 (LF)
Test2 (CR)

In the above records I need to differentiate both the records and LF should in one file and the CR should be in another.

You may be able to use string.match() or string.search() for your case. Your regex would be something like /\n/ for LF or /\r/ for CR.