MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

How to read a certain number from a file?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg42132] How to read a certain number from a file?
  • From: cyberdude <quake_earthNOSPAM at hotmail.com>
  • Date: Fri, 20 Jun 2003 04:57:31 -0400 (EDT)
  • Organization: Hong Kong University of Science and Technology
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

Suppose I have the following text file (file name is abc.txt):

...................................................
..... 3 children ....... he carries 2 .............
...................................................

If I am given the words 'children' and 'he carries' but no other words and
it is assumed that they appear only once in the file, how can I extract the
numbers '3' and '2' which are next to these words in the file and put them
into two variables with Mathematica?  Thank you in advance.

David


  • Prev by Date: Mathematica changes weak inequalities to strong inequalities
  • Next by Date: Appending data to a existing file
  • Previous by thread: Mathematica changes weak inequalities to strong inequalities
  • Next by thread: Re: How to read a certain number from a file?