So the Apple thread recommended changing the txt to csv. This didn't work, my file was already csv, properly formated etc. No, changing to txt did the trick.
I'm finding it harder and harder to recommend switching from Microsoft to Apple. This sort thing just shouldn't be happening.
Three sources I've poured over when developing my own processes for importing users include: http://support.apple.com/kb/PH15663 and the man pages for dsimport and dsexport.
For OD, it appears you have to define the format of the file you're using to import records. While the help page above indicates there are a handful of required attributes, I found I could import just the two fields you described above and the system automatically assigned UID information.
The top line of the file being used to import the records defines the format. It includes four hex codes, the record type, the number attributes, and a list of the attributes.
The default hex codes work nicely for me:
0x0A End of record is indicated by a new line
0x5C The escape character is defined as \
0x3A The field separator is a : (not a comma)
0x2C Each value in the field is separated by a comma
For your purpose, the record types are standard users, dsRecTypeStandard:Users.
Your number of desired attributes is 2, and their values are: RealName and RecordName.
So, the file that should work for you is:
0x0A 0x5C 0x3A 0x2C dsRecTypeStandard:Users 2 RealName RecordName
User One:user1
User Two:user2
...
User XXX:userX
Please be aware though that Server.app can fill in some but not all of the missing data. I recommend building an import file that includes all the required attributes.
Also, dsimport provides the --template option that obviates the need for field descriptions if your file has all seven standard fields.
I realize the question is a few months old, but hopefully this will help someone in the future.
Best Answer
You'll need more than the
cat
command, as described here:Say you have 3 CSV-files:
file1.csv
,file2.csv
, andfile3.csv
and want to join them tobigfile.csv
and your header is always (only) the first line, then useeither (keep header from first file "file1.csv"):
or (remove header from all files who's names begin with "file"):