Computing.Net > Forums > Programming > Batch file-add column names to CSV

Batch file-add column names to CSV

Reply to Message Icon

Original Message
Name: renegade01
Date: October 19, 2007 at 05:49:15 Pacific
Subject: Batch file-add column names to CSV
OS: windows 2000
CPU/Ram: 1024MB
Model/Manufacturer: x
Comment:

Hi guys

Can you please tell me what script to write in a batch file so that it adds column names to a .csv file. So for example I have a file now that comes through as:

1 2
1 3
2 4

but I want these columns to have a name of 'A' and 'B'. Any help appreciated, thanks in advance.

Sham


Report Offensive Message For Removal

Response Number 1
Name: Mechanix2Go
Date: October 19, 2007 at 06:08:43 Pacific
Subject: Batch file-add column names to CSV
Reply: (edit)

@echo off

echo A B > new.csv
type my.csv >> new.csv


=====================================
If at first you don't succeed, you're about average.

M2



Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Batch file-add column names to CSV

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software