Batch file to delete a file
Posted: 12 Jun 2017 09:08
I run a mapping tool to convert a flat file into a CSV file.
I run this job every 20 minutes.
When there is a file to convert it works great and produces exactly what I need. Example below.
All Rounds / Franchises,,,,,
12/06/2017,,,,,
Delivery Date,Customer,Reference,Item,Description,Quantity
13/06/17,COOP019,23327-A-054,R016,Cheese Topped Roll 4s,4
13/06/17,COOP019,23327-A-054,R012,Cheese Scones 3s,3
13/06/17,COOP019,23327-A-054,R009,Fruit Scones 3s,2
However if there isn't anything to convert it still tries to create a file but it just creates the headers of the file and no lines.
All Rounds / Franchises,,,,,
12/06/2017,,,,,
Delivery Date,Customer,Reference,Item,Description,Quantity
So I am sending out files to suppliers that don't actually have any meaningful data in them.
So what I'm looking for is a batch file to be able to see if there is any data on the 4th line and if not to delete it/move it elsewhere.
Any ideas?
Cheers
Wolfy
I run this job every 20 minutes.
When there is a file to convert it works great and produces exactly what I need. Example below.
All Rounds / Franchises,,,,,
12/06/2017,,,,,
Delivery Date,Customer,Reference,Item,Description,Quantity
13/06/17,COOP019,23327-A-054,R016,Cheese Topped Roll 4s,4
13/06/17,COOP019,23327-A-054,R012,Cheese Scones 3s,3
13/06/17,COOP019,23327-A-054,R009,Fruit Scones 3s,2
However if there isn't anything to convert it still tries to create a file but it just creates the headers of the file and no lines.
All Rounds / Franchises,,,,,
12/06/2017,,,,,
Delivery Date,Customer,Reference,Item,Description,Quantity
So I am sending out files to suppliers that don't actually have any meaningful data in them.
So what I'm looking for is a batch file to be able to see if there is any data on the 4th line and if not to delete it/move it elsewhere.
Any ideas?
Cheers
Wolfy