Batch scripting - creating CSV files from a list

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Zxarr

Thread Starter
Joined
Nov 8, 2007
Messages
1
Greetings,

I am trying to write a script that will take a list of items from a file and append them into a CSV file...

This script will run each day, taking each item from the 'item.txt' file and appending it to the end of the last line of a csv file that is already there:

The itemlist.csv file looks like this before the items are added:

Code:
date,time,foo,bar
and must look like this afterwards:

Code:
date,time,foo,bar,item1,item2,item3,item4

The number of items in the item.txt file can change each day.

Now, if this were bash shell scripting, no problems, but I have to do this on a Windows Server...

Thanks.
 
Joined
May 11, 2007
Messages
56
You could create a text file containing a single comma and then use this batch file to get the result you are looking for.

@echo off
copy itemlist.csv + comma.txt + item.txt tmp.csv
del itemlist.csv
ren tmp.csv itemlist.csv

John Hensley
www.resqware.com
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top