As I understand your question, you want to change a semi colon delimited file to a comma delimited file by replacing all semi colons with commas. And you want to exclude a specified number of lines from the beginning of the first file. If that is so, then code like what’s shown below can accomplish that in VBA.
Sub Dat2Csv()
Const FILE_IN = "C:\Program Files\Compass\20080718.dat"
Const FILE_OUT = "C:\Program Files\Compass\20080718.csv"
Const START_LINE = 5
Dim vIn, vOut As Variant, sLine As String, iLineCnt As Long
vIn = FreeFile()
Open FILE_IN For Input As vIn
vOut = FreeFile()
Open FILE_OUT For Output As vOut
Do While Not EOF(vIn): DoEvents
Line Input #vIn, sLine
iLineCnt = iLineCnt + 1
If iLineCnt < START_LINE Then
Else
sLine = Replace(sLine, ";", ",")
Print #vOut, sLine
End If
Loop
Close vIn
Close vOut
End Sub
You may want to replace the constants with parameters or references to specific worksheet cells once you have tested the code with the constants.