This forum is for scripting questions rather than script requests.
What have you tried so far and why did it not work for you? You should post your code, a few sanitized but still representative lines of your input csv file and the error messages if you get some. Please format all of this as code using the code tags “PRE”. Thanks in advance.
there are some challenges which i am going through:
we have duplicate columns on line 3, if we change the column names then ok else error out but as per business process we can not modify CSV at all.
Solutions:
whether i take the index number of the third line but can not do that as well (due to change in future)
OR take the second line as parent header and third line as child header and try to find the value as ParentHeader.ChildHeader which i am not able to go through.
… me too … … Please go back and format your code and sample data as code.
… that’s actually impossible for valid csv files …
… so you might change that business process if you have the need for your script to work and help the business with it.
… any future changes will likely break the functionality of a dependend process.
I don’t know what “ParentHeader” or “ChildHeader” is but there is a third option you may not have considered yet. Simply skip all 3 existing header rows and add your own ones with the parameter -Header of the cmdlet ConvertFrom-Csv.