M
M
martensit2018-03-21 07:07:29
C++ / C#
martensit, 2018-03-21 07:07:29

Is it possible to "bite off" 10 KB from the end of a giant text file with a c# snippet?

There is a 3 GB text file.
You need to split it with a c# snippet into 2 files, 2.999990 GB and 10 KB.
It does not matter from the end it will "bite off" or from the beginning.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
FreeBa, 2018-03-21
@martensit

More or less like this.

int SIZE = 10 * 1024;

BinaryReader binReader =  new BinaryReader("{FILE}");
binReader.BaseStream.Position = FileSize - SIZE;
byte[] array = binReader.ReadBytes(SIZE);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question