Sub ReadEntireFileAndPlaceOnWorksheet()
Dim X As Long, FileNum As Long, TotalFile As String, FileName As String, Result As Variant, Lines() As String
FileName = "C:\Users\Mohamed samatar.DSSE-EMEA\Documents\EQVL\Test\WHVP113_140910_TTinsug_TT_299Data_PUoff_WOT-TakeOff_NotKickDown_gearD_FelLambda.dat"
FileNum = FreeFile
Open FileName For Binary As #FileNum
TotalFile = Space(LOF(FileNum))
Get #FileNum, , TotalFile
Close #FileNum
Lines = Split(TotalFile, vbNewLine)
ReDim Result(1 To UBound(Lines) + 1, 1 To 1)
For X = 1 To UBound(Result)
Result(X, 1) = Lines(X - 1)
Next
Range("A1").Resize(UBound(Result)) = Result
End Sub
I have some files in the .dat format,these files contain some valuable information however they can be quite big, trying to open each file in notepad and extracting the information I need is not efficient at all, as it takes notepad a long time to open each file. I have come across this Binary Access Read function which apparently opens large files and allows you to read them very quickly. I was wondering how to find/ get specific lines of information, can you use a similar function to say the find function or is there another way to get information this is what I have so far. All it does is tell me the file type, essentially I want to be able to search for specific string value, or If I could just dump all the text in EXCEL and sort from there any guidance is useful.