536 reputation
211
bio website
location
age
visits member for 1 year, 9 months
seen 5 hours ago

9h
comment Conditional string replacement
This replaces items in col 2 when col 2's entry is "Can" and not items in col 3 when col 2's entry is "Can" (as asked). How would you adapt this to this requirement?
Oct
15
comment Conditionally formatting elements in a list
Worked! Thanks SO much.
Oct
15
comment Conditionally formatting elements in a list
the result of 18/12/2013 18:53 should be 2013-12-18 18:53:00
Oct
15
comment Conditionally formatting elements in a list
My data is a row, column setup, so a list of lists. The one column that I want to apply this to is a mixture of date strings, normal strings and reals and some other data types so I can't simply use the Head of string to replace. Eg of my data: {{"aaa","18/12/2013 23:32",433},{"aaa","test",345},{"ddd",455,675}}, the second "column" being the one I need to do the replacement on if it's a date of the form I'm looking to replace.
Oct
15
comment Conditionally formatting elements in a list
I just tried it but I don't know what to put instead of the ee-. I'm trying to replace my date of this format 18/12/2013 18:53 with a date of this format 2013-12-18 hh24:mm:ss (where the ss will just be 00).
Oct
15
comment Conditionally formatting elements in a list
I will try that but can you please explain what you have written in words so I know what it means? I think it means "take this list {"18/12/2013 19:53", "r", 5} and replace all strings with the format matching x/x with a format of xx-" The part after /. I'm a bit hazy on what it means or what I'm doing. I'd like to understand properly. Thanks for the help.
Oct
15
comment Conditionally formatting elements in a list
I have a similar problem but with dates. I need to change the format of an entry if it is a string representing a date (18/12/2013 19:53 for example) and leave it alone if it is not. I think I need to Map my date function to the list, but conditionally so that it doesn't map on to strings that are not dates. How can I do this?
Oct
13
comment Conditional string replacement
Thanks so much for your help.
Oct
13
accepted Conditional string replacement
Oct
13
comment Conditional string replacement
So I can say Replace[list, {x_, y : ss,} :> {x, y, "This"}, 1] ? I thought I'd have to refer to an element of like Table[Replace[list, {x, y : ss[[i]], _} :> {x, y, "This"}, 1],{i,1,10}] for example and that would leave me with something I didn't want. Could you elaborate as to how I'd use ss(the list of alternatives) in the example instead of writing out the whole list?
Oct
13
comment Conditional string replacement
So instead of writing "can" | "cann" ....how do I refer to the list {"can","cann",...} and not hard code the items? That is why I thought of using Table, something like Replace[list, {x_, y : {list}[[i]],_} :> {x, y, "This"}, 1]
Oct
13
comment Conditional string replacement
Thanks, that pretty much solves it but I have an addition to the question. What if instead of just replacing all items in column 3 with "This" when column 2's entry is "can", I also want to apply this rule when items in column 2 are any in a list {"can","cann",...}. I have tried using Table but this just gives me x sets of lists, each one with one rule applied.
Oct
13
comment Conditional string replacement
Can you please walk me through what these symbols mean so I can use them in future? The first option you have given I read like this:
Oct
13
asked Conditional string replacement
Jul
5
awarded  Self-Learner
Jul
2
awarded  Curious
May
22
comment Sensitivity Analysis: Global Sensitivity and Screening
I also need to do this. If I write something to do it I will share it with you here. If you have found the solution in another place Belisarius please post it here.
May
21
revised Extract a list of all built-in functions used in a notebook
added 36 characters in body
May
21
comment Extract a list of all built-in functions used in a notebook
This also causes error messages but seems to output what I need as well. Thanks.
May
21
comment Extract a list of all built-in functions used in a notebook
So this is a custom function. Do I put the filepath in place of nb_ ? When I do that I get an error message ToExpression::sntx: Invalid syntax in or before " \!(StandardForm`\\ecsdbn-srv-02\lara_jordan$\Cleaner Kumba\Cleaner Kumba Tool Non-Encoded Notebooks\Initialization.nb) " and some other error messages.