Skip to main content

All Questions

Filter by
Sorted by
Tagged with
10 votes
1 answer
216 views

How can I get rid of Background from a String?

For explanatory purposes I have marked parts of a string with different backgrounds. But this string is part of some Mathematica expression, which processed. My program worked fine before I added the ...
Adalbert Hanßen's user avatar
5 votes
2 answers
277 views

Automated generation of homework questions for line problems

I try to help my children in their subjects, I built a small code so that it has as output questions regarding the equation of the line, but I have not been able to modify it so that the result comes ...
padre's user avatar
  • 273
2 votes
2 answers
157 views

How to program a situation like the following in mathematics and generalize the process to other configurations?

Distribute the numbers from 1 to 10(view image) so that the sum of each row and each column is the same and a) the maximum possible b) the minimum possible (I put it from 1 to 10 for ease) I know it ...
BeTDa's user avatar
  • 500
5 votes
1 answer
152 views

Jaro distance in MMA

I'm trying to program Jaro distance as requested by this page I've done the following code that works well for the next two pairs ("MARTHA", "MARHTA") and ("DIXON", "DICKSONX") but when I try with ("...
bullitohappy's user avatar
  • 1,299
10 votes
1 answer
2k views

How to export strings as pure ASCII?

The "PrintableASCII" characters set consists of 97 characters, including space (\[RawSpace]) and two control characters: the ...
Alexey Popkov's user avatar
0 votes
1 answer
125 views

How to fix this issue with storing an expression as a String and returning it with ToExpression

( Update: Note the "." in the expression, this is most likely what causes the problem. )** Starting point of my question is the following code, which works as expected: ...
nilo de roock's user avatar
4 votes
2 answers
203 views

What is the Mathematica string expression to extract the innertext of an HTML element?

Consider the following example of text extraction. ...
nilo de roock's user avatar
2 votes
1 answer
252 views

Please explain some unexpected behavior of StringJoin [closed]

Consider the following command: ...
nilo de roock's user avatar
1 vote
1 answer
107 views

How to iterate over an "Input" function?

I wasn't sure what to name this title, I will explain this code just incase some people actually aren't running it on Mathematica..This code will ask you "what is #1 * #2", where #1 and #2 are random ...
Brandon's user avatar
  • 481
2 votes
0 answers
118 views

How to implement a regular grammar in Mathematica 10.0 onwards?

I would like to see a new answer to this question: How to implement a regular grammar? considering the introduction of GrammarRules in 10.0 ( 2014 ). ( I don't know if this question satisfies the ...
nilo de roock's user avatar
2 votes
1 answer
102 views

What is the best approach in converting strings from web imports back to their original types?

Consider the following list ...
nilo de roock's user avatar
17 votes
2 answers
1k views

How to parse a clojure expression?

Clojure is a lisp-like language that runs on JVM and in Javascript. I just started learning it and I'm building a simple parser with Mathematica to understand and visualize it. Like other lisps every ...
M.R.'s user avatar
  • 31.8k
4 votes
1 answer
810 views

How do I use StringReplace to replace repeated characters?

Suppose I have str = "dededekmkmkmvkfjdedemkvmlvdedekfmmdedededemkmkde" And I want to replace the repeated "de"s to one and produce (in a real example, the "de"...
Harry's user avatar
  • 2,745
0 votes
1 answer
941 views

How to implement the for loop to replace text strings or texts?

I wonder define a bunch variables named like $X_1$, $X_2$, $...$, $X_n$. Is there some smart way to declare them instead of by pure typing. One trick I can image is to use the for loop,...
user avatar
1 vote
1 answer
79 views

How to reference StringExpression named parts from a package without full Context path?

I have a long StringExpression in a package returned by a function. There are some named parts in the expression that I would like to reference when I use the ...
Edmund's user avatar
  • 43.2k
2 votes
0 answers
153 views

How to efficiently find parts of a string with beginning and ending specified?

I'm trying to find specific URL addresses from a html document. The addresses can be found between the strings "href=\"" and "\" class=\"listing". The problem is not including strings like this: "href=...
user's user avatar
  • 1,897
0 votes
1 answer
84 views

Data file organized in strings

I am working in a data set : The original question, They are strings of thousands stars,and each one contains a lot of parameters, and the following item is called identifies, they are the names (...
locometro's user avatar
  • 861
0 votes
2 answers
214 views

Exctrating data information from a file.txt

I really did previous long search in the site and I couldn't find any answer that might help me. So I am asking it. I have the following data set, https://onedrive.live.com/redir?resid=...
locometro's user avatar
  • 861
14 votes
1 answer
647 views

CSS Selectors for Symbolic XML

Symbolic XML is a convenient way of managing XML in Mathematica, at least for casual use or small tasks. Here and elsewhere you can find examples of XML handling in Mathematica, including XSLT/XPath ...
Fallible's user avatar
  • 793
12 votes
5 answers
4k views

What is the fastest way to extract a substring from a huge string?

I develop an algorithm to find the most common substrings of a given length n up to a certain distance l in front of a pattern p in a huge sequence S. E.g. I want to find the most common hexamers (...
g3kk0's user avatar
  • 3,328
1 vote
3 answers
588 views

Replace with position and order number

question conversion1 : Convert "[AA]AB[AA]BB[AA]B[AA]CCC" to "[A1A2]A3B1[A4A5]B2B3[A6A7]B4[A8A9]CCC" conversion2 : Convert <...
HyperGroups's user avatar
  • 8,649
4 votes
2 answers
2k views

String replacement of special characters [duplicate]

The function ...
March Ho's user avatar
  • 649
13 votes
4 answers
521 views

Unencoding encoded URLs in a function

Is there a built-in function for decoding encoded URLs in Mathematica? I would like to convert an encoded URL, for example ...
March Ho's user avatar
  • 649
3 votes
3 answers
375 views

How do I construct a pure function to extract data fields from records that are strings?

How can I get from datasegment format to the finalsegment format with a pure function? The data fields are fixed length. There ...
Hp Radojewski Schäfer Von's user avatar
6 votes
2 answers
3k views

Split string into sub-strings of length n [duplicate]

Possible Duplicate: Partition string into chunks How can I split a string into sub strings of length n? For example I have a string "ABCDEabcde1234" I ...
Sponge Bob's user avatar
19 votes
2 answers
2k views

Lexicographic ordering of strings in Mathematica

I recently realized that Mathematica seems incapable of comparing strings in the "normal" expected lexicographic order. Indeed, for some simulations, I need to process text directly, without fiddling ...
Jérémie's user avatar
  • 433