Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

bat files????

  • 08-07-2004 12:41AM
    #1
    Registered Users, Registered Users 2 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: 95,988 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