# Working With Large Files¶

VisiData handles moderately large files reasonably well. But if a particularly large file is slowing VisiData down, the tips and tricks below can help.

## Select a random sample of rows¶

In VisiData, you can create a randomly-sampled copy of any sheet. To create a random-sample sheet, press Shift-R. At the the prompt, type the number of rows you’d like to include, and then press Enter.

## Only load part of the file¶

If you’re only using VisiData to preview a dataset, consider loading just the beginning of the file.

### From the command-line¶

If you’re working with a simple CSV file, you can accomplish this by using head on the command-line, combined with vd -f csv e.g.,:

head -n 1000 faa-wildlife-strikes.csv | vd -f csv


That will load the first 1,000 lines of the file. (Because the REMARKS column contains some newline characters, the 1,000 lines correspond to slightly fewer than 1,000 rows.)

Alternatively, you can use a written-for-speed tool, such as xsv, to slice or filter the file before loading it into VisiData. E.g.,:

xsv search "CHICAGO" faa-wildlife-strikes.csv | vd -f csv