I would like to get the first X Bytes from a very large CSV file. I basically just want to get the first two rows so I get the column names and an example of the data in each. However, I know that this isn't going to be possible so I would like to just download enough bytes to reasonably have enough data to be able to look at the first two rows. I am therefore trying to download the first 64kB.
I am trying to do this using the s3 manager ( https://github.com/aws/aws-sdk-go/blob/master/service/s3/s3manager/download.go )
I tried using something like :
downloader := s3manager.NewDownloaderWithClient(svc, func(d *s3manager.Downloader) {
d.PartSize = 1024 * 64
d.Concurrency = 1
})
` This hangs though. I'd imagine I am just telling it to download the file with a small part size and it stops there and never returns anything.
Can anybody cleverer than me tell me how I can download just the first X bytes of an S3 file in go? Thanks!