Taking part of CSV file

I have a very large CSV file which I should analyze. It's too big so I can't even open it in Excel or Stata. So I want to take first few rows of it and explore the data, and then select necessary columns.

What I need it a software which take specific rows or columns of a csv file and output it as a separate file. (e.g. I want to take Row 1~2500 or Column A,B,C and E) Which can do this?


Use PowerShell.

PS > get-content \Large.csv -totalcount 2500 > Output.txt

enter image description here

You put \Large.csv as the Path to your Csv.

You put Output.txt as where you want the output to go say C:/Usere/Documents/Output.txt

enter image description here


You may try the free Microsoft Add-In Power Query (from Excel 2010) or rather the open source R statistical software .

The first is quite intuitive for Loading and transforming your data for several source types. However the ouptut will be as a table in Excel or in the data model (Power Pivot feature). With VBA there is however a way to produce a CSV, s. Blogpost from Kasper de Jonge.

R is probably also suitable to subset your datas or later produce an output CSV file. First hints here or on Stackoverflow.


I'd suggest you look at TextQ (disclaimer - I'm its developer). It can import a big CSV file and lets you view and query it.

You can query via a UI Query Builder or SQL, which supports limit and offset parameters. Then you can export any query to a CSV file, which can be imported in MS Excel or others.

Here is a video demo and more detailed tutorial.

You can get it from the Mac App Store or Microsoft Store (coming soon).