question

how do i write a script that'll open what i entered and scan it for a certain line of text.

for example, i enter a filename (that exists) and in that file i want to scan a certain word that'll show how much of that word appears throughout the file.

hi,
this sounds like homework? if so, please read the rules!

Smartass answer:

You open a text editor and write some code. You run it. If it doesn't work, figure out why and update the code. Run it again. Repeat the last two steps until complete.

Let us know when you're done or stuck (but have actually done something).

Tips:

  1. Decide what language you're going to use.

  2. Do a Google search, and spend about two seconds figuring out how to read an argument from a script.

  3. Spend another five seconds on Google to figure out how to open the file and loop through the lines.

  4. Write code to loop through the lines and print them out to the screen.

Once you've done that, you're more than halfway there. Do some more searching on Google (or these forums) until you have something at least partially working, and then ask for help. I bet you'll get a much nicer response than the smartass one above. Maybe even from me.

ShawnMilo