Hey guys,
I am new to MS. I've been trying to add string into a table, something like
--------------------------------------
url | http://domain.com |
--------------------------------------
time | 2009-09-22 14:20:05 |
--------------------------------------
Here is my sample script. I would like to know if there is any other efficient way to retrieve data.
Let>strHTML={"url: http://domain.com, time: 2009-09-22 14:20:05}"
//remove opening bracket {"
Let>pattern={"
RegEx>pattern,strHTML,1,matches,new,1,,strHTML2
//remove closing bracket, "}
Let>pattern="}
RegEx>pattern,strHTML2,1,matches,new,1,,strHTML3
MessageModal>strHTML3
Thanks in advance.
putting data into a table
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
If I've understood you correctly you want to end up with two rows, and two columns and in this case the columns are split by the ": " and rows by ",". So we could do:
Code: Select all
let>html=
Let>comma=,
Let>str=url: http://domain.com, time: 2009-09-22 14:20:05
Separate>str,comma,rows
Let>html=<TABLE>
If>rows_cout>0
Let>r=0
Repeat>r
Let>r=r+1
Let>html=%html%<TR>
Separate>rows_%r%,: ,cols
If>cols_count>0
Let>c=0
Repeat>c
Let>c=c+1
Let>this_cell=cols_%c%
Let>html=%html%<TD>%this_cell%</TD>
Until>c=cols_count
Endif
Let>html=%html%</TR>
Until>r=rows_count
Endif
Let>html=%html%</TABLE>
MessageModal>html
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?