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
| Date | Amount |
| 2024-01-01 | 100 |
| 2024-01-02 | 200 |
| 2024-01-03 | 300 |
| 2024-01-04 | 400 |
After
| Date | Amount |
| 2024-01-01 | 100 |
| 2024-01-02 | 200 |
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.
Related tools
Sort Rows
Sort your CSV or Excel file by any column — alphabetically or numerically, ascending or descending.
Filter Rows
ProKeep only the rows that match your criteria — filter by column value, text match, or emptiness. No formulas needed.
Remove Empty Rows
Clean up blank rows from CSV and Excel files automatically. Get a compact, analysis-ready dataset.
Papiral
Tabular