Automate Importing files with VB.net Routine

I need a Visual Basic routine that would re-format a CSV file from one application to be imported into Sage X3 V11. The application is moving invoice and payment details from one system to another. The basic difference is that the source file has one record per product sold, which includes all information of the transaction (customer, product, quantity sold, price, tax, payment and payment type). The converted file to be imported all needs to be structured differently. Two files are needed, one with the sales order information and the other with the payment details. Furthermore both of these files need to be formatted with a header and detail records for each sale. Also the customer number needs to be changed prior to importing. The customer file would have to be downloaded prior to conversion and a routine developed to convert the customer number. All converted files in CSV "flat file" format. Source file is in Excel.