There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen boot bsod computer connection crash css dell drive driver drivers email error ethernet excel explorer firefox firefox 3 freeze game hard drive internet internet explorer itunes laptop malware monitor network networking outlook outlook 2003 outlook express partition password printer problem problems ram router slow sound sprtcmd.exe trojan usb virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Batch scripting - creating CSV files from a list


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
Zxarr's Avatar
Junior Member with 1 posts.
 
Join Date: Nov 2007
Experience: Advanced
08-Nov-2007, 10:54 AM #1
Batch scripting - creating CSV files from a list
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.
johnhe's Avatar
Member with 56 posts.
 
Join Date: May 2007
Experience: Advanced
08-Nov-2007, 12:01 PM #2
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
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:10 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.