Graphics

 View Only
  • 1.  Reformatting names with visual logic

    Posted 01-05-2024 11:46

    Hi! I am trying to reformat names that come in from datalinq as Last, First into First Last through visual logic. I am pretty sure this is possible, but I am not entirely sure what the best way to go about it is. Any ideas?



    ------------------------------
    Philip Doherty
    Elon University
    ------------------------------


  • 2.  RE: Reformatting names with visual logic

    Posted 01-06-2024 09:57
      |   view attached

    This came from either a training session I went to a few years ago or from the Ross site, but hopefully it will get you on the right path.  We use it with the names that come from NCAA live stats



    ------------------------------
    Jay Cofield
    University of Montevallo- Dept of Comm
    ------------------------------



  • 3.  RE: Reformatting names with visual logic
    Best Answer

    Posted 01-06-2024 11:39

    The script is only 5 lines of code if you want to try it.

    if InStr(text, ",") > 0 then

        text = split(text, ",")(1) & " " & split(text, ",")(0)

    else

       text = text

    end if



    ------------------------------
    Malcolm Thorpe
    xpression design
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



  • 4.  RE: Reformatting names with visual logic

    Posted 01-06-2024 11:42

    I am relatively new to scripting, should I put this in the object, or the scene itself? Also, do I need to declare any variables beforehand?



    ------------------------------
    Philip Doherty
    Elon University
    ------------------------------



  • 5.  RE: Reformatting names with visual logic

    Posted 01-06-2024 11:47

    you would put this script on the text field in your scene that is linked to your data. No variables needed. It looks at the text and finds any commas, then uses that to split the string and flip the order. If there are no commas, it just passes the name through. It's pretty slick. Be sure to compile the script afterwards. (little orange logo in the script window up at the top)



    ------------------------------
    Malcolm Thorpe
    xpression design
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



  • 6.  RE: Reformatting names with visual logic

    Posted 01-06-2024 11:51

    It works! Thank you so much, I am going to try and teach my self some visual basic as it seems like scripting gets more and more useful.



    ------------------------------
    Philip Doherty
    Elon University
    ------------------------------



  • 7.  RE: Reformatting names with visual logic

    Posted 01-06-2024 11:56

    Nice work. Visual Basic is a handy tool to have in your toolbox. I'm glad you gave it a shot. 



    ------------------------------
    Malcolm Thorpe
    xpression design
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------