There is normally a way to extract data from databases into CSV text files.It's also possible to produce a text file manually by using an application such as notepad.
See here for more information on producing CSV files.
As well as taking care to ensure that the CSV file you have produced is valid, you also need to ensure that the CSV file includes a header row.
The cn (common name) forms part of an objects distinguished name.
This attribute must be unique within it's parent container (organizational unit).
This script can be used to update Active Directory User attributes from a CSV file.
One column in the CSV file is used to match rows in the CSV file to user accounts in Active Directory and the other columns are used to update attributes.
This attribute name is "s AMAccount Name" and must be included in your CSV file (unless you plan to use a different search attribute).
You might find the Active Directory Schema Guide on this website useful for identifying the correct attribute names to use.
There is always an element of risk involved in performing bulk updates to Active Directory.
Please be sure to test updates in a QA environment before applying them to your live domain.
The first step in updating user accounts from a CSV file is to produce a valid CSV input file for the script.