Consulting

Results 1 to 4 of 4

Thread: CSV filter

  1. #1

    CSV filter

    Hi there guys!

    I have a CSV file with over 15million rows which weighs about 3.15GB. Needless to say I can't open it on excel but I don't need all the data anyway.

    The rows start with either DA or DH in the first column. I want a batch script or something that will extract rows starting with DH only.

    Any suggestions on how I can do it?

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Recent question here which may assist. Look at Posts 2 & 3
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    993
    Location
    Also an article here.

    David


  4. #4
    Thanks guys for your suggestions.

    I did it using a windows batch file (thank god it was a CSV)

    -- start of batch file --
    @echo off
    for /f "tokens=* delims=," %%a in ('findstr /B "DH" C:\temp\GTAM2310.002') do echo %%a >> C:\temp\testM1.csv
    - end of batch file --

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •