need help parsing CSV file

L

luther

Hi,

I am on Windows 2000 using Excel 2000.
I receive 15 CSV files on a daily basis.
These CSV files are auto-generated by some non-Excel software.
Each CSV file contains over 100 rows of data.
I import these CSV files into Excel and run reports on them.
About 60% of the data in these CSV files is of no use to me.
I would like to get that 40% data extracted from CSV files *before*
importing into Excel.
(I have tried doing this within Excel with Autofilter and such but it
takes too long.)
But since these are CSV files, they can be trimmed at the command line
via BAT files.

Here is what the CSV data looks like:
----------------------------------------
|,idnum,|,typenum,|,56,|,locnum,|, etc.
|,idnum,|,typenum,|,22,|,locnum,|, etc.
|,idnum,|,typenum,|,01,|,locnum,|, etc.
|,idnum,|,typenum,|,88,|,locnum,|, etc.
|,idnum,|,typenum,|,41,|,locnum,|, etc.
|,idnum,|,typenum,|,22,|,locnum,|, etc.
|,idnum,|,typenum,|,09,|,locnum,|, etc.
|,idnum,|,typenum,|,61,|,locnum,|, etc.
----------------------------------------

Where:
The | char is the delimiter.
The idnum, typenum, locnum are non-uniq and non-sorted.
The etc. represents additional data in the row which is not shown
here.

I am interest in the 3rd column which contains 56,22,01,88,41,22,09,61

I would like to:
1. Have a BAT script that grabs all the rows where the 3rd column is
greater than 60.
2. So in this case ONLY rows 4 and 8 would apply because they contain
88 and 61 respectively.
3. Copy these 2 rows to a file called INPT.CSV

I am not a batch file expert. I have tried doing this on my own but I
am struggling and running out of time.
Can you give me the batch script that does this trimming?


Thank you.
 
P

Phil Robyn

luther said:
Hi,

I am on Windows 2000 using Excel 2000.
I receive 15 CSV files on a daily basis.
These CSV files are auto-generated by some non-Excel software.
Each CSV file contains over 100 rows of data.
I import these CSV files into Excel and run reports on them.
About 60% of the data in these CSV files is of no use to me.
I would like to get that 40% data extracted from CSV files *before*
importing into Excel.
(I have tried doing this within Excel with Autofilter and such but it
takes too long.)
But since these are CSV files, they can be trimmed at the command line
via BAT files.

Here is what the CSV data looks like:
----------------------------------------
|,idnum,|,typenum,|,56,|,locnum,|, etc.
|,idnum,|,typenum,|,22,|,locnum,|, etc.
|,idnum,|,typenum,|,01,|,locnum,|, etc.
|,idnum,|,typenum,|,88,|,locnum,|, etc.
|,idnum,|,typenum,|,41,|,locnum,|, etc.
|,idnum,|,typenum,|,22,|,locnum,|, etc.
|,idnum,|,typenum,|,09,|,locnum,|, etc.
|,idnum,|,typenum,|,61,|,locnum,|, etc.
----------------------------------------

Where:
The | char is the delimiter.
The idnum, typenum, locnum are non-uniq and non-sorted.
The etc. represents additional data in the row which is not shown
here.

I am interest in the 3rd column which contains 56,22,01,88,41,22,09,61

I would like to:
1. Have a BAT script that grabs all the rows where the 3rd column is
greater than 60.
2. So in this case ONLY rows 4 and 8 would apply because they contain
88 and 61 respectively.
3. Copy these 2 rows to a file called INPT.CSV

I am not a batch file expert. I have tried doing this on my own but I
am struggling and running out of time.
Can you give me the batch script that does this trimming?


Thank you.

See the responses in alt.msdos.batch.nt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top