HomeCSV ToolsTruncate Rows

Truncate CSV — Keep First or Last N Rows

Keep only the first or last N rows of your CSV or Excel file. Ideal for sampling large datasets or taking the most recent records.

What this tool does

Working with a million-row export when you only need the first 1,000? Or want the most recent 500 transactions? Tabular's row truncation trims your file down to exactly the size you need — from the top or bottom — without loading it into a spreadsheet.

Problems it solves

  • Sampling the first 500 rows of a large file for a quick review
  • Taking the most recent N records from a time-ordered export
  • Reducing file size before sharing with a collaborator
  • Creating a test dataset from a production export
  • Extracting a header-plus-sample from a large file for schema validation

Example

File truncated to keep only the first 2 data rows.

Before

DateAmount
2024-01-01100
2024-01-02200
2024-01-03300
2024-01-04400

After

DateAmount
2024-01-01100
2024-01-02200

Frequently asked questions

Can I keep rows from the bottom instead of the top?

Yes. Choose 'bottom' to keep the last N rows — useful for time-sorted data where the most recent records are at the end.

Is the header row counted?

No. The row count applies to data rows only. The header is always preserved.

Is this free?

Yes. Row truncation is available on the free plan.

Can I combine truncation with other operations?

Yes. Add Sort Rows before Truncate Rows to get, for example, the top 100 highest-value records.