Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Is it possible to read a specific column with a readln?

VeraVera Member Posts: 3
Hello!

I have a text file with various columns. I want that my delphi program reads and store in an array the first and fourth column, for example. As this text file can be very big I don't want store it completely in the memory.

Thanks. ^_^

Comments

  • ManningManning Member Posts: 1,621
    : Hello!
    :
    : I have a text file with various columns. I want that my delphi program reads and store in an array the first and fourth column, for example. As this text file can be very big I don't want store it completely in the memory.

    I dont think you can read only certain portions of a plaintext file, but once you have read in the whole line you can definitely choose which portions to save in memory. Just write a function that takes the line and seperates it into the appropriate columns, and then only put the 2 you want into the array.
  • slicer69slicer69 Member Posts: 272
    readln(file_handle, var_you_want, dummy_var, dummy_var, var_you_want2);

Sign In or Register to comment.