Importing CSVs into MagnusBilling - Converting UNIX to DOS

Usually when someone has difficulties importing CSVs, the issue is related to the character the system uses to line break.

  1. Windows: \r\n
  2. Linux: \n
  3. macOS: \r

This makes the system read the information incorrectly.

Why does this happen?

This happens because the method used to import the CSV is "LOAD DATA LOCAL INFILE", which is known as being the fastest method to import CSVs onto MySQL. This method has some parameters, one being "LINES TERMINATED BY" where you're expected to tell the function what is the character used to line break. Sadly, we can only set it for one type, not three. Therefore, the one our team chose to use is the Windows one, because of the market share the system has.

How to solve the problem?

  • Windows:
    • Open the CSV, save as and select the type as Windows.
  •  LINUX:
    • Execute "unix2dos FILE.csv"
  • macOS:
    • Execute "unix2dos FILE.csv"