Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
86 views

Convert tikz (in tikzit) code to a graph in Mathematica

I want to convert a TikZ graph from TikZiT into a graph in Mathematica. I want to retain the vertices, edges, and the positions of the vertices. As for the color of the vertices or the style of the ...
licheng's user avatar
  • 2,091
3 votes
2 answers
152 views

StringTake :Cannot take positions 1 through 1 in

Here is the code that aims to figure out first letter of each sentence in a string of text: ...
Splendid Digital Solutions's user avatar
4 votes
0 answers
76 views

Why is MatchQ faster than StringMatchQ in testing string matches?

Suppose I have myStrs, a list of one million alphabets (i.e., 26 million single-character strings): ...
Andrew's user avatar
  • 10.5k
0 votes
2 answers
43 views

Why bar chart starts on the x axis leaving a gap in the first unit

BarChart[StringLength[StringSplit["A long time ago, in a galaxy far,far away", ","]]] While I can follow the reason for three bars as there ...
Splendid Digital Solutions's user avatar
3 votes
2 answers
141 views

OrderlessPatternSequence for StringExpression

I am using v12.2.0. As a minimal example, the idea is to find all words that have two pairs of matching characters and two other characters for a total of 6 ...
Syed's user avatar
  • 59.3k
3 votes
3 answers
308 views

I need an MMA function to convert two lists like {0, r} {s, 0} in one list of rules {0->"s","r"->0}

I need a Math. function to convert two lists like {0, r} {s, 0} in one list {0->"s","r"->0}; I.e. the letters must be enclosed in " ", but the numbers not. I have ...
florin's user avatar
  • 2,166
3 votes
1 answer
165 views

Convert a list of strings of the form {{2 "x" +"y"->4 "x" + 5"y"},{5 "x" ->7"y"}, ...}, to {{"2 x +y"->"4 x +5 y"},{"5 x" ->"7 y"},...}

Convert a list of strings of the form {{2 "x" +"y"->4 "x" + 5"y"},{5 "x" ->7"y"}, ...} to ...
florin's user avatar
  • 2,166
1 vote
1 answer
55 views

Draw a graph on vertices inputted as "A"+ 2 "B", 3"A" + 4"B", etc (the input form is imposed) in Euclidean space, with A->(1,0), B->(0,1)

I have a Mathematica script, called FHJ, with four main arguments: vertices, edges, weights of edges, groups of vertices, which produces a graph with vertice labels given in the list vertices, ...
florin's user avatar
  • 2,166
5 votes
4 answers
390 views

Elegant way to examine a string by "word" (whitespace-delimited substring)

Suppose I have the following list of strings myStrList: ...
Andrew's user avatar
  • 10.5k
2 votes
4 answers
142 views

Creating a string pattern to specify a single letter character, which is lowercase, without using LowerCaseQ

I'm running quite an old version of Mathematica: version 9.0. I wish to create a function oneLetterLowerCase that takes a string ...
Andrew's user avatar
  • 10.5k
3 votes
1 answer
128 views

Converting a set of reactions represented by strings separated by spaces, or by newline, to a list of similar strings

In the Macaulay package ReactionNetworks.m2, a set of reactions is represented as {AB1-->B+C C2-->D} with new line separating the first reaction AB1-->...
florin's user avatar
  • 2,166
-1 votes
1 answer
89 views

A string with mathematical operators (fractions, superscripts, subscripts, etc.) and a variable number [closed]

I want to create a list in Mathematica where a word contains a number that changes within it. However, I want the number to appear as a superscript or subscript or in a fraction etc. How can I do this?...
Kώστας Κούδας's user avatar
1 vote
0 answers
48 views

Replacement of strings within lists

i have a string list: lis = {"a",{"b","c"},"d"} ...and would like to replace "c" with "Q", to give <...
Suite401's user avatar
  • 5,025
1 vote
1 answer
32 views

StringReplace with several replacement rules doesn't work as expected

I understand that, according to WL documentation, StringReplace["16.",{aux:NumberString:>"1/"<>aux,".":>"*3/2"}] ...
Loke S. Pott's user avatar
3 votes
2 answers
112 views

How to specify that case should be ignored within a string pattern?

One can use StringMatchQ to test whether a string matches a string pattern. One can use the IgnoreCase option of ...
Andrew's user avatar
  • 10.5k
3 votes
3 answers
241 views

Inserting a 0 in Specific Symbols

I have a very large network with 1000's of edges. Below is a small sample. The N is my label for Node and the number that follows is a unique identifier. I want to make all the edges on either side of ...
user42700's user avatar
  • 1,837
1 vote
1 answer
144 views

I want to plot the group delay of the following mathematica code but it takes too long time

I am working on a Mathematica project where I want to plot the group delay. The problem is this code is running too slow. Is there any possibility of speeding up the code? Here is the original code: <...
abdul wahab's user avatar
0 votes
1 answer
59 views

How to convert strings to the same pattern

I have some sets of random strings. These strings may have one of the special characters (+,-,=) as a prefix or suffix, or both. Different special characters cannot be mixed in the same set. I want to ...
qwerty's user avatar
  • 1,361
0 votes
1 answer
45 views

General::tag weird behavior

Is there anyone here who can explain this strange behavior? Consider the following code: ...
hlediks's user avatar
  • 91
3 votes
4 answers
106 views

Randomly replace some letters in words with hyphen

I have a list containing some related words ...
monfneg's user avatar
  • 679
2 votes
1 answer
85 views

Internal`MRealToString Gives Scientific Output From Large Inputs. How To Stop This?

The undocumented Internal`MRealToString works just fine for reals up to 999999. For anything over it outputs scientific notation. I don't need scientific, I need simple decimal. ...
Anton's user avatar
  • 1,193
7 votes
3 answers
256 views

How to Pick Out Strings of a Specified Length

Suppose I have the following edge set: ...
user42700's user avatar
  • 1,837
2 votes
3 answers
155 views

How to Control StringContainsQ [duplicate]

I have the following code ...
user42700's user avatar
  • 1,837
2 votes
1 answer
38 views

StringJoin fails in .m

Do[( ND$T$thr[j] = j; ND$T$thr[j] >> "test_" <> ToString[j] <> ".dat"; ), {j, 1, 3}] This works without issue in a ...
Noldig's user avatar
  • 143
3 votes
3 answers
127 views

Extract doi from a text string

I have a large list with bibliometric information including the doi like this example: ...
M.A.'s user avatar
  • 771
4 votes
3 answers
365 views

How to express the notion of "from "a" to the nearest "z"" with patterns?

If I compute this: StringCases["abczabvncz", "a" ~~ __ ~~ "z"] It yields: ...
Red Banana's user avatar
  • 5,573
1 vote
1 answer
83 views

All possible tuples satisfying conditions

Let $\beta = (\beta_1, \beta_2, \ldots)$ be any given sequence of non-negative integers with all but finitely many $\beta_i$ zero. I want to collect all possible tuples $\beta^{\prime}= (\beta_1^{\...
Anantadulal paul's user avatar
0 votes
2 answers
94 views

Is it possible to have ToString operate on an expression containing Prefix (@) ? for example exp = [email protected]

ToString[exp] results in the string form of the evaluated form of exp when exp contains Prefix (@), such as when exp is an email address. How can such an expression be converted to a string?
user96574's user avatar
3 votes
5 answers
190 views

Importing Specific Data from a Text File

I am quite new to Mathematica. I have a text file that upon importing has a repetitive structure with characters included. I need to extract only the following in numbers only (no letters, dash lines, ...
LollyPop's user avatar
5 votes
4 answers
247 views

Select elements from a list based on alphabetical order criteria

I have this code to generate the anagrams for a 6 letters word: ...
Rodrigo's user avatar
  • 1,544
2 votes
0 answers
80 views

How to convert the <table> element into Grid

I got the html source code for this element for this page in Wikipedia: ...
yode's user avatar
  • 27.2k
0 votes
0 answers
58 views

How to convert RowBoxes into list of math expressions?

I have following RowBox which represents Step By Step solution of undefined integral ...
nnarek's user avatar
  • 1
0 votes
0 answers
36 views

Coverting .nb file code content to string type using NotebookImport

For my work I need to import the notebook and get all the contents from the code cell. For this task I chose ...
ordenarion's user avatar
2 votes
1 answer
53 views

Intra-Symbolic Wild Card Pattern Matching

I have the following custom expression structure I am parsing: Theorema`Knowledge`Q$TM[ Theorema`Language`VAR$[Theorema`Knowledge`VAR$x$TM]] I already was able to ...
marie_antoinette's user avatar
3 votes
4 answers
177 views

Sort Column as a Row

I have a = {1, 2, 3, 10}; b= {2, 3, 4, 8}; t= Do[If[a[[i]]+b[[i]]>3,Print[a[[i]]],"No"],{i,1,4}]; 2 3 10 I need to get the result; t={2,3,10}
Alyasaa Jasim's user avatar
7 votes
3 answers
277 views

Replace number in string with ? and /;

I am trying to make the following: StringReplace[{"A4", "A#3"}, {"A" ~~ x_ -> "B" ~~ x}] This should replace ...
Red Banana's user avatar
  • 5,573
3 votes
0 answers
65 views

How to improve Burrows-Wheeler Transform performance?

I have implemented the Burrows-Wheeler Transform as below: ...
flinty's user avatar
  • 25.9k
0 votes
0 answers
72 views

How to convert LaTeX to expression without interpreting variables as products?

I need to convert some LaTeX code to mathematica expressions. So far I have used ToExpression["ab", TeXForm] yielding ...
Suppenkasper's user avatar
1 vote
1 answer
47 views

Why is StringSplit dropping empty entries? [closed]

I am parsing a CSV and whenever the trailing records are empty: StringSplit[",2,,4,,",","] I get: {"2&...
user13892's user avatar
  • 9,751
1 vote
0 answers
134 views

Butterflied Strings Shortest Character Solution

The shortest character solution for Butterflied Strings on Wolfram Challenges according to the CODE CHARACTERS functionality is 40. I have a solution with 42 ...
Navvye's user avatar
  • 171
0 votes
1 answer
62 views

Pattern matching with DeleteCases

I'm using Mathematica 14.0 and I'm having a pattern match problem with DeleteCases. The example below illustrates the problem. I define a test string followed by two patterns that both nominally match ...
jparm's user avatar
  • 1
3 votes
2 answers
114 views

Writing Mathematica code for putting in commutation relations in a string

I am trying to write a mathematica code to accomplish the following: For a given $n$, consider $(ab)^n$, which is a string of the form $\underbrace{ababab...ab}_{n\text{ times}}$. I want to replace $...
Ryan Hendricks's user avatar
1 vote
1 answer
71 views

Compressing a file's name string

I was working with files where each name records a lot of information about what is in its respective file and wanted to compress it a little bit. So I wanted to change it's 'base'. And I noticed that ...
Teg Louis's user avatar
2 votes
3 answers
237 views

The problem of matching consecutive cross-line strings

I have a file named "s0.log",There's a lot of this structure in there: You can see that the strings "Alpha occ.eigenvalues --" and "Alpha virt.eigenvalues --" will be ...
我心永恒's user avatar
  • 1,630
1 vote
0 answers
68 views

Why is SequencePosition or SequenceCases so slow on large lists?

I observed that SequencePosition or Sequence Cases on a list of around 60'000 digits is so slow that I had to sort out to string pattern matching. Is this normal behavior or should Wolfram have a look ...
markilux's user avatar
  • 121
3 votes
5 answers
292 views

How to select elements from a list of strings?

...
Tugrul Temel's user avatar
  • 6,409
3 votes
1 answer
127 views

Behaviour of `ToExpression` inside a function definition

I want to create a function that takes in an array of unknown size and do some index operations on it. I am using strings to construct the expression and then trying to use ...
Himanshu Chaudhary's user avatar
3 votes
5 answers
150 views

Sorting logic and generation of letter sequence

In the context of experimental designs, it is common to generate the various treatment names to build the factorial design table. The table of the 2^2 design reads : For the 2^3, the table reads : ...
Jocelyn Minini's user avatar
2 votes
1 answer
62 views

FromLetterNumber and "" bug or intended behaviour

DigitQ behaviour appears consistent "" is treated as 0 by DigitQ` ...
IntroductionToProbability's user avatar
1 vote
1 answer
74 views

Difficulty using StringCases to obtain desired substring

I have extracted and stored some plaintext strings (derived from a pdfs) from the web that I wish to search for various values following certain text substrings that are different for different ...
Stuart Poss's user avatar
  • 1,975

1
2 3 4 5
27