Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear members;
I'm stuck with the following chalange. I must read some (not all) records from a textfile into a workbook. But...... The Excel version is 2003 (can and may not be 2007) and the textfile contains over 250.000 records !! The fields from the textfile are seperated by semi-colons and I only need those records where the 5th field exceeds 0. The textfile is not fixed-width, so I can't fix this position in a record (but it is the position I need to find). What method should I use to extract those records using VBA. Is it possible to alter this module ? Private Sub Extract_Records() Open ThisWorkbook.Path & Application.PathSeparator & "Invoice.txt" For Input As #1 r = 1 Do While Not EOF(1) Line Input #1, Data 'Do not import a record that begins with Total If Not Left(Data, 5) = "TOTAL" Then '---- I think I should change this line of code, but How ? It must find the 5th field 0 'Import record r = r + 1 Cells(r, 1).Value = Data End If Loop Close #1 End Sub ---- I hope that this is clear enough !! -- Regards; Mark Rosenkrantz -- Spreadsheet Solutions Uithoorn Netherlands -- E: W: www.spreadsheetsolutions.nl -- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Trying to NOT import some records in a large text file | Excel Programming | |||
XY Scatter-problems with large data records | Excel Discussion (Misc queries) | |||
Manipulate textfile with VBA | Excel Programming | |||
very large text and CONTINUE records | Excel Programming | |||
Export as Textfile with VBA | Excel Programming |