Looks like you might want SSIS for this.
Plenty on the topic in the stairways section.
Use it to load the file into the table, then you can use T-SQL to modify it.
Or modify the data in the SSIS package before loading it into the database.
Exports exactly the same, but in reverse.