Discussion Locked

Batch file - codes

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi

I have a notepad file( say test1.txt ) which contains data like

---------------------------------------
03/11/04 08:58:41 , , ,KEANO REAVES, RAJIV,3111093

03/11/04 08:58:42 , , ,MORPHINUS TO NEO, MALVIKA, 6721378

03/11/04 08:58:43 , , ,MOFIUS TO NEO, RAJAN, 3409072

03/11/04 08:58:44 , , ,OPTION-C, MANJUNATH TUNGA, 3419607

03/11/04 08:58:45 , , ,C SMITH TO KANUREAVES, SRINATH, 3379771

03/11/04 08:58:46 , , ,MORSEUS TO NEO, BHARATH, 56733724

03/11/04 08:58:52 , , ,OPTION-C, KARTHIK, 5724538
-----------------------------

in this at the end of each line (set of numbers )are phone numbers

what i want is, on execution of a BATCH file, it should copy only the phone numbers to another notepad file ( say test2.txt )

can any one pls tell me the code for the BAtch file for this purpose

Thanks in advance

3 replies

by carsten.holfelder

You can't do it with a batch, as the text file is a comma delimited file you can import it into a spreadsheet program and the copy the required column to a txt file

by kn_abhilash

thanks for the answer

i know how to do it through spread sheet, but i want to do it using an automated process
can i do this in html or something

by joncr

You cant do this through dos but I would try perl or awk (both text manupilation scripting languages). Quite easy to learn as well.

This discussion is closed to new replies.