Questions tagged [string-manipulation]

Questions on the manipulation of String objects in Mathematica, and the functions used for these manipulations.

Filter by
Sorted by
Tagged with
0
votes
0answers
34 views

Concatenate string with the value of each element of a vector/list

I have a vector/list t = {4, 5, 6}. I want to output each element (its value) of t in a string of characters. For example, the ...
4
votes
3answers
131 views

Extracting a string located before a keyword

I am new to Wolfram and i would like to extract a few words from a website based on locating a key string. Specifically, i am trying to access the website: https://www.sec.gov/Archives/edgar/data/2178/...
3
votes
3answers
139 views

Finding the index of certain strings in a list

I'm actually using a dataset of much greater dimensions and length but I simplified my problem of string patterns in order to ask this question. ...
1
vote
2answers
65 views

How to search a directory of nb files for a string?

I would like to find a particular string in a set of nb files in a directory but am having problems interpreting the results of my code. Here's a simple example: In directory d:\mathematica, I have ...
3
votes
2answers
107 views

How to substitute the variables in StringForm to an expression/function

I have some variables derived in StringForm. For example; variables = StringForm["x=``,\[Delta]=``", 5, 10] How to ...
1
vote
1answer
35 views

How to change the format of ReadList

I have a quick question, please help me if you have an idea: 1- i need to read the data in another format, in the desired answer the records must be separated by &&, and without braces { } . ...
1
vote
2answers
52 views

combine those $n$ lists without specifying whole $n$ sets explicitly?

Suppose I have $n$ lists, How to combine those $n$ lists without specifying whole $n$ sets? I mean; For a given lists list1={{3, 1, 1}, {1, 3, 1}, {1, 1, 3}} list2={{2, 2, 1}, {2, 1, 2}, {1, 2, 2}} ...
2
votes
1answer
38 views

Join variable with string in a label plot

I have a simple problem regarding writing in a plot label variable and numbers. I have checked in other forums, but I was not able to solve my problem. I have this plot ...
2
votes
0answers
41 views

Store pattern names in variables, and use them in Condition (/;)

I am trying to create patterns whose form is not hard-coded, and which are not explicitly directly written. For that I want to use one list of pattern names to name some parts of a ...
1
vote
1answer
55 views

how to create a list of strings using two other lists

Given two lists lst1 and lst2: ...
1
vote
4answers
71 views

Link elements from list to make more lists from certain lenght [closed]

How can I go from this list [36, 73, 84, 0, 73, 83, 0, 69, 69, 78, 0, 84, 69, 75, 83, 84, 31] to this [0000003673, 8400738300, 6969780084, 6975838431]. Is there also a way to make the elements the ...
0
votes
2answers
68 views

How to remove quotation marks in Table List

I have Import a .txt Data = Import["files.txt", "Table"]; But the Data ...
3
votes
2answers
85 views

Remove words from a string that contain special characters

I have a string like this: string="there is a humble-bee in Hanna's garden"; Now I want to exclude those words that contain "-" and "'"...
1
vote
3answers
51 views

Extract a row from dataset based on two strings

Say I have a list as below: ...
1
vote
0answers
28 views

How to draw a line marking where each chapter occurs in a text? [duplicate]

I am performing a text analysis on C.S. Lewis's book The Lion, the Witch, and the Wardrobe. I have created the following analysis of textual occurences of Aslan or Lion, Peter, Lucy, Edmund, Susan, ...
1
vote
0answers
145 views

How to Create an Efficient Word Square Algorithm?

I am working on the Wolfram Challenge Babbage Squares. I have looked at the following resources in order to come up with an idea for how to find all the possible word squares: Word Squares and Beyond ...
0
votes
0answers
65 views

How to Shape Text?

Imagine I have a certain number 23819657294172004194219023914217958273128471531429470113 If I convert it to a string with ...
3
votes
2answers
284 views

How to extract email addresses from a text file using Mathematica

I have a text file which I have uploaded here. I want to find all email addresses in this text file. I just know that some of them are after "Subscription Date" expression (I don't know if ...
0
votes
1answer
36 views

Converting parts of some string into another notation

I have a big string of data and most of them are in the form Name = number^{number}_{-number}, some are in the form Name = number \pm number. I what to convert the latter into the notation. For a ...
0
votes
0answers
26 views

How to extract detail subsection of Metadata

I am trying to get subsection of the Metadata such as image, title, url, title, description but it is impossible. Can you advise how to get this information from the follow code and results. ...
7
votes
1answer
200 views

How to set deeper patterns in arguments within function definitions. For example if an argument must be a list of 1 or more strings

Suppose I want to define a function whose argument must be a List of only Strings and List must have at least one member. I know how to require that the Head must be a List but how does one qualify ...
0
votes
1answer
57 views

automatic extracting number from a text with given signs

I am trying to get a number from a plaintext with the staring sign of "Nho xanh không hạt" and ending sign of "đ" automatically with different method but it doesn't work. In detail,...
4
votes
1answer
131 views

How to display warning message inside manipulate?

Using the code shown, Reynolds number is calculated for given parameters. Is it possible to display a warning message to the user if a parameter is outside applicable range? e.g., if the fluid ...
3
votes
4answers
195 views

List all substrings of a number

Need some help listing all substrings of a number X=219 The output should be Output= {2,21,219,1,19,9} Order does not matter for this problem Any help is appreciated
1
vote
0answers
48 views

Can't Export string made with StringForm?

This works. It returns "acb". StringForm["a``b", "c"] This doesn't work. ...
1
vote
1answer
53 views

Grouping together same exponent terms in a multivariate monomial

This is a rather simple question but for some reason, I am spending too much time on this. Suppose I have a monomial in 4 variables, each raised to some linear combination of 3 exponent variables: <...
2
votes
0answers
56 views

Inverse Dictionary Lookup

Example: Using WordDefinition: WordDefinition["surreptitious"] ...
0
votes
1answer
51 views

Map, EvenQ, and the correct syntax [closed]

Using If and EvenQ defines a pure function, which when applied to an integer, computes its square when the integer is even, and ...
1
vote
1answer
36 views

StringReplace with RuleDelayed to replace each integer digit character in the strings with a digit that is 1 less than the number

Use StringReplace with RuleDelayed to replace each integer digit character in the following strings with a digit that is 1 less than the number represented by the digit character. (Hint: Use ...
0
votes
0answers
40 views

StringExpression: Give all pairs of identical characters in the string

While going through StringExpression (https://reference.wolfram.com/language/ref/StringExpression.html), unable to figure out the following: Give all pairs of identical characters in the string: Input:...
5
votes
2answers
212 views

using StringReplace and StringPattern to convert exp(...) to Exp[....]

I am looking at a file generated by another CAS. I'd like to convert it to Mathematica syntax. Only issue is how to convert exp(....) to ...
4
votes
5answers
546 views

String permutation

I have a string "abcd". Is there any way in Mathematica such that when I apply some exchange operator $P^{ab}$ it gives me string "bacd"? Edit: After reading answers I felt like I ...
7
votes
1answer
140 views

Fill in the StringBlank

I have a string that has blanks marked by a marker; (in this case, an underscore): "f_ath_r". I can execute the following command to get the word. ...
1
vote
1answer
65 views

Extending NumberForm

I'd like to define a function, call it NumberF, that takes a real number n and two naturals l...
3
votes
1answer
114 views

Sublist creation, splitting and joining

I have a not very usefully-formatted string list and I would like to create certain sublists from it. ...
5
votes
3answers
193 views

Extract specific string from a list of strings

My question is similiar to previous questions (see here or here), although the issue is maybe somewhat more complicated: I have a list with strings like this: ...
2
votes
1answer
56 views

How can I convert the inverse hyperbolic function I defined and built-in inverse trig functions to TeXForm the way I prefer?

In Mathematica,the inverse hyperbolic functions are displayed with the prefix "Arc" like "ArcSinh[]", which I thought incorrect and misleading. Since the hyperbolic angle is ...
2
votes
1answer
95 views

Using StringExpression in a string list

I'm trying to search in a list of strings those who match a pattern. But it seems that StringExpression in functions such as ...
2
votes
1answer
40 views

How to join two partially overlapping strings without duplication?

I have this list of strings; first string overlaps with the second string, and second string overlaps with the third string. I want to combine those into a single paragraph. ...
1
vote
2answers
106 views

Removing Commas From Numbers in Datasets Expressed as Strings and Converting To Numbers

The following code generates a dataset from a table within a webpage: ...
1
vote
1answer
62 views

Getting a symbol from a string without it being replaced by its value?

Consider the following code running on a fresh Mathematica session with no symbols defined: p[s_String] := Protect[s]; p["x"] This doesn't do anything ...
5
votes
1answer
146 views

Strings are constants? (Kind of output hack to circumvent that needed)

I have an "internal" notation (since some stuff is equivalent and can be manipulated via patterned expressions in the function F), say ...
0
votes
0answers
35 views

$P=QRS$ decomposition of given list-3-unordered list

This is an extended version of my previous posts, $P=QRS$ decomposition of given list, P=QRS decomposition of given list -2 -unordered list Inspired by @Bill, and considering multiplicities, ...
3
votes
2answers
123 views

How to Copy a number from a string

I want to copy a section of a string, which lies between two fixed string sections. How to do it? For example if the string is "...\abcd124\145@cvdf\efgh...". How to tell Mathematica to copy ...
0
votes
1answer
46 views

P=QRS decomposition of given list -2 -unordered list

This is an extended version of my previous post, $P=QRS$ decomposition of given list Based on the answer and comment of @Bill, Form all permutations of P. Form Q as the first element of each of those,...
1
vote
1answer
91 views

$P=QRS$ decomposition of given list

This is an extension of my previous post $P=QR$ decomposition of given list Now for this time, I want to decompose arbitrary list $P$ into three pieces for ordered or non-ordered cases. Based on the ...
1
vote
1answer
53 views

$P=QR$ decomposition of given list

For given arbitrary lists, I want to decompose the list into two parts and assign individual lists. i.e., I want to decompose, $P=QR$. And I can think of its decomposition in two cases: ordered and ...
0
votes
0answers
74 views

Creating new variable names, Symbol or ToExpression

One can create new variable names by Symbol : In[1] Table[Symbol["x"<>ToString[i]], {i,1,5}] Out[1] {x1,x2,x3,x4,x5} But it is also possible to ...
0
votes
1answer
45 views

How to Set Text Format by User-Defined Function with Input as String

I have simple but annoying problem here. I guess it occurs to many Mathematica users. The thing is that I wish to define a function to format the text in Mathematica. Yet, I don't know whether it is ...
0
votes
1answer
42 views

Converting HyperInt Hlog to Polylogtool G [closed]

how do I replace efficiently HyperInt's Hlog (in maple expression) {Hlog(Y,[1]),Hlog(X, [1, -Y + 1]),Hlog(X,[1,1,1])} in an expression into PolyLogTool G: {G[1,Y],G[1,-Y+1,X],G[1,1,1,X]} Basically, ...

1
2 3 4 5
23