Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

bat files????

  • 08-07-2004 12:41am
    #1
    Registered Users Posts: 648 ✭✭✭


    hi suppose i have a csv file with a load of entries

    what i want to do is create a file for each of those entries containing info from the entries

    is this possible to do so with bat and if not what can i do it with?

    tnx


Comments

  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    Excel macro?


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Any scripting language will do what you need.

    Basic, VB, Java, Perl, etc.

    It is most likely not possible using CMD batch commands.


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 92,264 Mod ✭✭✭✭Capt'n Midnight


    Depends on which OS you have - Microsoft have two different incompatible command prompts (DOS/Win9X and NT/2K/XP) and when you use external commands like Xcopy the syntax varies from version to version eg: in 3.x win /D:n means No network but in 9x means with Network etc. etc.

    in NT/2K/XP you would use the FOR /F command
    FOR /F "tokens=1-5* delims=," %%a in (file.csv) do @echo A=%%a B=%%b C=%%c D=%%d Rest=%%e

    To split in to files by column A
    FOR /F "tokens=1-5* delims=," %%a in (file.csv) do @echo %%b,%%c,%d,%%e >>%%a.txt

    could then use SORT and FOR /R or something too.


Advertisement