Hi,
I am writing a program that reads a text file and populate its contents into
a DBGrid
Each row inside is considered an record.
Each record is comprised of several fixed length columns
i.e: Product Column - 9, Barcode - 13, Width - 9, Weight - 9
Ex:
Prod-001 001-200-300 550.00 1100.2567
Prod-002 002-200-400 7100.00 1100.2567
Prod-0A 001-210-300 71000.00 1100.2567
I have 2 questions:-
1) Since the length/size of the text file can be vary.
How to write a code to get the no of lines in the files without looping
through the whole file ?
2) Which is more efficient ? Use collection or Dataset/Datatable to hold
those data?
Thank You.