# Solve problems from a txt or pdf file

I have tried in vain to recover problems from a flat file and from a pdf and pass them through the reduce option and have it solve the exercises one by one in batches. Any idea how to achieve it? The only thing I can think of is this instruction in its plain text version and in its pdf version

data = ReadList["https://www.dropbox.com/s/0novhzk3u0v15ix/e1.txt?dl=0", Word,RecordLists -> True];

data = ReadList["https://www.dropbox.com/s/ayr4jzgkihsly7e/e2.pdf?dl=0", Word,RecordLists -> True];

edit

• The link leads to an Error (500) page. Please provide a 1-click accessible link that is public.
– Syed
Apr 11 at 2:52
• Syed , Hello, the links work for me, but I put new links to drive,see edit Apr 11 at 3:51

(data3 = ReadList["C:/e1.txt", "String",
RecordLists -> True]) // TableForm

data4a = StringTrim[First /@ data3,
StartOfString ~~ Shortest[__] ~~ ") "]

data4 = ToExpression@data4a

res = Reduce[#, x] & /@ data4

(data5 = Join[{{"#", "expr", "sol"}},
Transpose[{Range@Length@data4, data4a, res}]]) //
Grid[#, Spacings -> {2, 1}, Alignment -> Left] &


$$\left( \begin{array}{ccc} \# & \text{expr} & \text{sol} \\ 1 & \text{x/(x-1)<1 } & x<1 \\ 2 & \text{2x/(2x+1)>1} & x<-\frac{1}{2} \\ 3 & \text{-2x/(3-x)<=2} & x<3 \\ 4 & \text{-3x/(2-x)>=3} & x>2 \\ 5 & \text{(x+1)/(2x-1)<1/2} & x<\frac{1}{2} \\ 6 & \text{2x/(3x-2) >2/3} & x>\frac{2}{3} \\ 7 & \text{(3x-1)/(1-2x)<=-3/2} & x>\frac{1}{2} \\ 8 & \text{2/(1-x)<2} & x<0\lor x>1 \\ 9 & \text{3/(2x-1)<=1} & x<\frac{1}{2}\lor x\geq 2 \\ 10 & \text{1/(2x+3)>=1} & -\frac{3}{2}1} & -5=2} & 1\frac{1}{2} \\ 17 & \text{(2-4x)/(2x-1) <=2} & x\in \mathbb{R} \\ 18 & \text{(x+2)/(x+1) <(x-2)/(2x+2)} & -6= 2 /(2x-4) } & x\leq 1\lor x>2 \\ 20 & \text{(x+2)/(x-1) +x/(2x-2)<=0} & -\frac{4}{3}\leq x<1 \\ 21 & \text{(x+1)/(2x+1)-1/(4x+2) <=1} & x\in \mathbb{R} \\ 22 & \text{1/(x-1)-1/(2x-2)>=1} & 1=0} & x\leq 1\lor x>2 \\ 24 & \text{(x+1)/(x-1) +(2x-1)/(2x-2)>=1} & x\leq -\frac{3}{2}\lor x>1 \\ \end{array} \right)$$

• wow , It's just what I thought, my most difficult question, it can be done from a pdf (attach one there) Apr 11 at 17:42
• I don't have the skill to extract data out of the pdf. I did try "Plaintext". Please wait and someone might provide an answer in due time.
– Syed
Apr 11 at 17:47