Tagged Questions

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

learn more… | top users | synonyms (2)

0
votes
2answers
62 views

How to solve ArcSinh equation for many differents parameters?

I am totally stuck trying to solve the equation below (1/2) x Sqrt[1 + 4 a^2 x^2] + ArcSinh[2 a x]/(4 a) == d Where a and ...
4
votes
1answer
147 views

How do I remove single-character whitespace between words, leaving multiple, contiguous, whitespace characters unchanged?

In a string, I want to remove only the single-character whitespace between printing characters, leaving any multiple, contiguous, whitespace characters between printing characters unchanged? What is ...
1
vote
2answers
53 views

Generate a sequence of names such as a1, a2, a3 [duplicate]

How do I generate the sequency {disp1, disp2, disp3, ...}? I tried the following but it didn't give me what I expected: ...
2
votes
5answers
193 views

How to join two strings one of which is Subscript?

If I write this one str=Subscript["x","y"]; StringQ[str] False How can I get str as string?
2
votes
4answers
85 views

Finding relevant parts in XML document

My qyestion is about a XML document and finding parts of strings. test = Import["C:\\Users\\filename.xml", "XMLObject"] This gives the following output: ...
1
vote
1answer
62 views

Transforming a nested list for textual output

Hello I have a data structure based on lists, with items, subitems and subsubitems, and I want to display a textual output with a description. ...
2
votes
2answers
141 views

Difference between double quotes

I have a notebook and I enter something like PlotLabel->"my label with dynamic number "<>ToString[strange] and I get errors like However, the double ...
2
votes
3answers
140 views

Graph showing valid English words obtained by insertion of single characters

I'd like the most efficient Mathematica code for making a formal tree graph whose nodes are valid English word strings (in DictionaryLookup[ ]) and directed links represent the relation 'insertion of ...
5
votes
1answer
140 views

Conditional string replacement

I have a list of text and need to replace an element based on the text that appears in the element before it. Example of my list: ...
2
votes
1answer
83 views

Convert matrix of strings to matrix of numbers [duplicate]

I have 101 files each with a lot of data. from C output. (.out files) I have imported them to Mathematica 9. However, Mathematica reads the data from each file as an element of a table. So I used ...
1
vote
2answers
69 views

How to define a function that counts the exponents

I want to define a function $F$ described as follows: The input of $F$ is a polynomial such as m*u*x^4*y + n*v*x^2*y^3 where $m$ and $n$ are constants, and ...
0
votes
2answers
66 views

text analysis: split document in seperated lines

For a text analysis I want to split a large document in seperated lines. Then I want to calculated for example the average number of words. A example of the document is the following: ...
2
votes
2answers
49 views

Retain or delete parts of textstring in tweets

For a twitter analysis I collected many tweets. For example: ...
12
votes
1answer
144 views

Bug in Operator Form of StringCases

According to the documentation there's an operator form for StringCases ?StringCases Here is the normal form ...
8
votes
2answers
513 views

A femme is a wife is a Frau

As can be seen from LanguageData["Properties"] // Multicolumn Mathematica's translation capabilities seem to be very limited. It can translate month names, ...
21
votes
0answers
222 views

StringCases is Confused with Patterns in Version 10.0.1

I observed the following with StringCases when trying to use rules/patterns. Here is a screenshot of the behavior: Not only is the pattern highlighted in red, ...
11
votes
7answers
606 views

Splitting strings into letter keys and integers

I have strings of the following form: string = "ABC123DEFG456HI89UZXX1"; Letter keys of variable lengths are followed by (positive) integers. I want to get this ...
4
votes
4answers
172 views

Splitting a string into substrings of length 1 and 2

There is already a thread on how to split a string into equal sized chunks. I'm wanting to split a string into sets of substrings of length 1 and 2. For example, if I have the string "123456", my list ...
6
votes
1answer
122 views

Understanding `Paste` and how to get a string from the Clipboard to use with `ImportString`

Trying to work on this question I got distracted by my first naive attempt of copying the data and then typing dat = ImportString[Paste[], "Table"] ...
7
votes
5answers
343 views

Splitting strings at lower case characters and numbers

I'm trying to split the strings of chemicals into their elements and numbers. See this example "Fe3O4" will be split into ...
6
votes
3answers
152 views

Isolating string characters

I have the following string: ...
6
votes
2answers
222 views

Converting a string into a nested list of strings

The following string can be converted easily into a list with ToExpression ...
5
votes
1answer
99 views

Simple string pattern crashes kernel

The following code crashes my Mathematica kernel (v9, MacOS): ...
2
votes
0answers
39 views

Is it possible to Compile the function with string argument?

As we can see from the Compile documentation, the typical arguments for Compile should be ...
0
votes
3answers
65 views

Unexpected behavior of rule-replacing with string concatenation [closed]

Here's the code. Clear[x,y,z]; {x,y,z} /. x_ :> ("^_^" <> ToString[x]) I get the result ^_^{x, y, z}, which is not ...
1
vote
3answers
119 views

Manipulate strings within a list

Let's say I have Solve[x^4 + 3 == 0, x] with output ...
6
votes
3answers
192 views

Problem with WordBoundary in string patterns

I am trying to extract from a string all words that end with "-man", but the problem is that WordBoundary does not seem to work as it returns whole string ignoring ...
4
votes
3answers
78 views

Question about Replacements and String Manipulations

I'm trying to get better at Mathematica and in the book I'm using (by Nancy Blachman) is the following question (which apparently was taken from another book: The Art and Science of C) which reads: ...
2
votes
1answer
81 views

How to efficiently process pasted content from PDF

I had selected a matrix in a PDF file, and paste it onto my MMA notebook. Below is the exact copy-pasted content: ...
5
votes
3answers
541 views

Caesar's cipher

How can Caesar cipher be implemented? I want to use StringReplace but I don't know how to write the replacement rule to replace the characters with, say, the ...
6
votes
1answer
198 views

Dataset and string conversion, using Internal`StringToDouble

i'm trying to get familiar with the new Dataset-stuff in Mathematica 10. As it will (hopefully) provide some benefit for me, I have started to convert my app to move from list and list of rules to ...
-1
votes
3answers
85 views

How do i import a list of files, choosing the name

I have this list of files, i'm using FileNames[{"*.txt"}, NotebookDirectory[]] to import it, but i just want the ones without inelastic on the name. How can i select just by the name? Thanks ...
2
votes
3answers
89 views

Table to text string [closed]

I know this is a simple question and there is a single command to do this but I have been looking for the command for 30+ minutes and cannot find it. I have a list that I want to put tabs between ...
4
votes
2answers
72 views

Can StringTemplate be extended to offer printf-like formatting capabilities?

Apparently, Mathematica has no real sprintf-equivalent (unlike any other high-level language known to man). This has been asked before, but I'm wondering if the new ...
0
votes
3answers
73 views

Positions of a string in a list [closed]

Sorry for the bad title..Didn't know how to describe this, feel free to change it to be more specific. I have a list in this form: ...
1
vote
1answer
30 views

StringCases: return list of outputs for each of several patterns

According to the documentation, StringCases[{s1, s2, ...}, p] returns {StringCases[s1, p], StringCases[s2, p], ...} but, ...
11
votes
2answers
192 views

ToExpression fails with long nested string expressions

Consider the following conversion from String to Mathematica Expression: ...
5
votes
3answers
236 views

String templating

I am pretty new to string processing in Mathematica. But I'm having some problems in doing simple string template filling to my mind elegantly. For example when doing export for my answer here, one of ...
2
votes
2answers
61 views

Using Table with arbitrary number of variables [closed]

Let $P=\{p_1,...p_n\}$. I would like a way to implent Table[Expression,{$p_1$,lim},{$p_2$,lim},...,{$p_n$,lim}] where n and lim are parameters defined by the user. Any ideas?
0
votes
0answers
43 views

importing a file with asterisk in its name (Linux machines)

I am trying to import a file: ...
3
votes
1answer
71 views

Convert an expression's symbols of form a$x to a[x]

I want a function that takes expressions of the following form: a$x and converts them to a[x]. In particular, consider the ...
7
votes
3answers
290 views

How to parse information contained in a file name

I have a set of files containing my data, and the file-names contain relevant information that I would like to extract. What I have is: ...
5
votes
6answers
779 views

Convert a string into a list of numbers

I got the following problem I don't know how to solve or if it's at all possible to solve(I'm quite new to Mathematica and don't have an IT background, so please explain slowly if possible:)) I'm ...
0
votes
1answer
94 views

Converting strings of the form “1.34e5” to real numbers? [duplicate]

ToExpresssion doesn't understand real numbers of the form "1.34e5". How do I convert the string ...
2
votes
2answers
107 views

how to take some parts of String with certain pattern

I have the large number of files in which the file's names follow certain pattern. for example here are names of two files ...
2
votes
2answers
83 views

Find names similar to a given name in a large data set

I'm trying to find a 'similar' name to every item in a list ...
2
votes
2answers
93 views

Importing Data and Devoting Their Names to Them

There are some files in a directory. I have used of SetDiroctory to access all of them. SetDirectory["C:\\Users\\SE7EN\\Desktop\\mathematica\\test"]; I can visit ...
8
votes
1answer
110 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 ...
1
vote
2answers
56 views

Alternative to Except in StringExpression when using StringMatchQ

According to this answer and the documentation for StringExpression, Except can only be used in StringExpression for classes of ...
0
votes
0answers
18 views

How would I take a variable from a string and reassign its value? [duplicate]

If I have string={a,b,c}, where a=1, b=2, and c=3, how would I reassign a value to variable "a" without directly typing a = _? If I type string[[1]], the out put is "1". How would I generate the ...