Jump to content
UBot Underground

Split On Delimter / Insert Data


Recommended Posts

Hi,

 

Within a table, I have a values stored as a list of URLS.    For example - 1.jpg, 2.jpg, 3.jpg, 4.jpg, ....  etc.

 

The URLS or in this case are file names are separated by commas.

 

My goal is to insert a variable into the list in the third position.

 

IE

 

1.jpg, 2.jpg, #VAR, 3.jpg, 4.jpg. 

 

I seem to have hit a roadblock.  Any encouragement or suggestions? 

 

 

 

Derek

Link to post
Share on other sites

Because unused plugins. It is quite cumbersome.

clear all data
set(#DataToAdd,"5.jpg","Global")
set(#AddToListPostion,3,"Global")
set table cell(&MyTable,0,0,"1.jpg, 2.jpg, 3.jpg, 4.jpg")
add list to list(%MyList,$list from text($table cell(&MyTable,0,0),","),"Delete","Global")
set list position(%MyList,0)
loop($list total(%MyList)) {
    set(#MyListItem,$next list item(%MyList),"Global")
    if($comparison($list position(%MyList),"= Equals",#AddToListPostion)) {
        then {
            add item to list(%MyListOut,#DataToAdd,"Don\'t Delete","Global")
        }
    }
    add item to list(%MyListOut,#MyListItem,"Don\'t Delete","Global")
}
set table cell(&MyTable,0,0,$replace(%MyListOut,$new line,","))

By Plugin

clear all data
set(#DataToAdd,"5.jpg","Global")
set(#AddToListPostion,2,"Global")
set table cell(&MyTable,0,0,"1.jpg, 2.jpg, 3.jpg, 4.jpg")
add list to list(%MyList,$list from text($table cell(&MyTable,0,0),","),"Delete","Global")
plugin command("Advanced Data Text File.dll", "list insert", %MyList, #AddToListPostion, #DataToAdd)
set table cell(&MyTable,0,0,$replace(%MyList,$new line,","))
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...