5
votes
5answers
265 views

Joining some strings in a list of strings

So, say I have a list of strings, representing lines in a file, like so: ...
1
vote
2answers
43 views

How to switch between a binary number as String and a as a list of digits?

I was trying with String Functions and I viewing any posts and have no results I want to know 1.- From cromo33 = Table[RandomInteger[], {i, 1, 33}] cromo33 ...
0
votes
3answers
80 views

string to complex number

Consider the following list MyList= {-0.0000396, -0.0000187167, "0.10259130990561813-0.0677132394802944i"} Head /@ MyList (* -> {Real, Real, String} *) In ...
2
votes
3answers
120 views

Counting instances where the two identical characters are at the same positions in two strings

Let $s_a$ and $s_b$ be two strings over a $q$-ary alphabet. For each character $(c_1,...c_q)$ in the alphabet, I'd like to return a pair of values $(r,k)$ where $r$ represents the count for the ...
5
votes
6answers
249 views

Convert array from {{…}} to “[[…]]”

I have made this function: conv01 = Map["["<>StringJoin@@Riffle[#,","]<>"]"&,Map[ToString,#,{2}],{0,1}]& to convert: ...
4
votes
2answers
244 views
3
votes
4answers
170 views

How to construct tuples with a given order?

How do I create a list of tuples with an ordering imposed on them, where each element is from a generating set? Specifically, I'm trying to create a listing of tuples $(x_1, x_2, ..., x_n)$ such that ...
18
votes
7answers
906 views

Elegant and fast way to join all string sequences

I want to do what title says: {"a","b",1,2,3,4,"a",2,2,2,"edg","?"} => {"ab",1,2,3,4,"a",2,2,2,"edg?"} in the most elegant way. For example one replacement rule for ...
5
votes
6answers
172 views

Selective thinning of string elements in nested lists

I have a nested list similar to this example list (but much bigger and more messy): ...
6
votes
1answer
108 views

How does `LongestCommonSubsequence` work?

When I recently came across this posting about LongestCommonSubsequence I was curious about how the function worked. ...
5
votes
2answers
233 views

Concatenate strings from different levels of list

After a lot of trouble I've finally come pretty close to what I want to do. I now have a list that looks like this: ...
14
votes
6answers
437 views

Splitting a list by specifying section headers

I have a list of strings called mylist: mylist = {"[a]", "a", "a", "[b]", "b", "b", "[ c ]", "c", "c"}; I would like to split ...
6
votes
3answers
202 views

Importing and manipulating strings - time data

I have a list of time durations, which are strings of the form: "hh:mm:ss". Here's a sample for you to play with: ...
7
votes
3answers
437 views

Specifying string patterns in DeleteCases

It seems that DeleteCases is not compatible with string patterns, at least directly (see, for example, this question). Is this true? If so, why is this the case? ...
3
votes
5answers
284 views

How to extract strings from the list with an additional condition on previous elements?

There are a long list of strings $s$ and two lists of substrings $s1$ and $s2$. I want to take all elements of $s$ which contain a substring from $s2$ and such that before it on no more than $n$ ...
10
votes
7answers
200 views

DateList coupled with String Operations

Through some webscraping, I have the following list: ...
4
votes
4answers
425 views

Creating lists from a string, separating words from numbers

Say I have a string that contains numbers and words, such as this one: string = "there are 1234 words and numbers 5678 in here $999"; How would I separate the ...
6
votes
2answers
251 views

How to choose variables from a list for a function and then use the solution in a subsequent function?

I am trying to calculate heating degree days and cooling degree days and output that information to a table. I am using mathematica's curated data to do this. In text this is what I would like to ...
6
votes
3answers
629 views

print the name of the variable in a list without evaluation

a := az + 1 b := bz + 5 list := {a, b} I'd like mathematica to print a = az + 1 b = bz + 5 so basically it needs to first ...
12
votes
7answers
559 views

DeleteCases on list of Strings

Consider the following: data={"AB","CD","AF"}; Now I would like to delete all String from data which starts with "A". ...
4
votes
1answer
253 views

Defining a string based sort function

I'm having a bit of trouble figuring out the right Sort syntax to use on a list of lists. Consider the following list: ...