Batch Help needed to add a column and details in a CSV file
Posted: 09 Sep 2007 14:22
Hi,
I require some help in modifying a csv file in batch.
I have a csv file that contains details obtained from a database. So an example construct is as follows: -
id, first_name, second_name, location
1, john, locke, 123.someroad
2, jack, shepard, 555.island
3, abc, khan, 888.house
4, popeye, sailor, 143.boathouse
What i need the batch script to do is to create another column in the csv file (housenum in this example) and to move the digits in the location before the period character into that column. So the output will be like: -
id, first_name, second_name, location, housenum
1, john, locke, someroad, 123
2, jack, shepard, island, 555
3, abc, khan, house, 888
4, popeye, sailor, boathouse, 143
I am rather new to batch scripting so not exactly how to tackle this. All help will be very greatly appreciated!
I require some help in modifying a csv file in batch.
I have a csv file that contains details obtained from a database. So an example construct is as follows: -
id, first_name, second_name, location
1, john, locke, 123.someroad
2, jack, shepard, 555.island
3, abc, khan, 888.house
4, popeye, sailor, 143.boathouse
What i need the batch script to do is to create another column in the csv file (housenum in this example) and to move the digits in the location before the period character into that column. So the output will be like: -
id, first_name, second_name, location, housenum
1, john, locke, someroad, 123
2, jack, shepard, island, 555
3, abc, khan, house, 888
4, popeye, sailor, boathouse, 143
I am rather new to batch scripting so not exactly how to tackle this. All help will be very greatly appreciated!