Event sender script from csv

Version 1
    Share This:

    Here’s a little perl script to send events from a csv file you may find useful if you need to send a bunch of test events.

     

    Run like this :

     

    K:\CD\Scripts\EVsend>Event_Sender.pl -h

     

    event_sender V1.0

     

    Usage:

    event_sender.pl [-n cellname] [-i inputfile] [-p time] [-h]

    -h     Display this help message

    -n     Sets cell to send to (default:pncell_SVR95)

    -i     inputfile to read events from (default:infile.csv)

    -p     pause time in seconds between events (default:0)

     

    Example :

     

    K:\CD\Scripts\EVsend>Event_Sender.pl -n pncell_svr95 -i infile.csv -p 3

    Running with cell=pncell_svr95, input file=infile.csv, pause time =3 seconds

    Reading input lines...

    There's 7 slots to look at

    Sending event number :1 of 5....sleeping for 3 seconds

    Sending event number :2 of 5....sleeping for 3 seconds

    Sending event number :3 of 5....sleeping for 3 seconds

    Sending event number :4 of 5....sleeping for 3 seconds

    Sending event number :5 of 5

     

    Sample infile.csv included. First column must be CLASS, the rest of the slots you can define on the first line of the csv.

     

    If comma is not a good separator for your events, you can change that at the start of the script :

     

    my $sep=","; # Adjust to set the field seperator in the csv

     

    It doesn't do much sanity checking, garbage in garbage out…….