Problem:
When importing TermSet using CSV file in SharePoint 2010, you get error:
An error was encountered while attempting to import the term set at line [LINENUMBER] of the submitted file and some data may not have been cleaned up. Please ensure that this file is a valid csv file and adheres to the correct format as in the sample file ImportTermSet.csv.
Where [LINENUMBER] is the number of the last line in your CSV file.
You have verified that CSV file is indeed valid, and there is definitely nothing wrong with the last line. Also, when removing the last line, the error persists, but contains LINENUMBER-1.
Solution:
Make sure capitalization in the terms imported in your CSV is same for all parent items. You cannot have parent items with different capitalization.
You will get the error if any parent level term capitalization doesn’t match, e.g.,
,,,"True",,"First level term","First second level term",,,,,
,,,"True",,"first level term","Second second level term","Third level term",,,,
will give you the error, while
,,,"True",,"First level term","First second level term",,,,,
,,,"True",,"First level term","Second second level term","Third level term",,,,
works fine.