It appears you have not registered with our community. To register please click here ...

Author Topic: foreach help and one line help  (Read 2355 times)

hanmontan

  • Newbie
  • *
  • Posts: 1
  • Karma: +10/-0
    • View Profile
    • Email
foreach help and one line help
« on: February 20, 2008, 03:37:50 AM »
Hi could you please recommend me a site with a good tutorial on how to use foreach in linux. I\'m trying to make it to get the every element inside one file, where each element is separated by whitespace and put it together with another file which is the 2nd element of 5 elements which are separated by commas.

Okay, here\'s my other problem. I\'m trying to get the number of times set of strings have appeared on a text file. For example, if the words were scissors and paper. then the output would be
30 scissors
5 paper
I could do
30
5
but I can\'t quite insert the text on the file, since printf and echo don\'t work well with pipelining. btw, is it possible to do it in one line, without using semicolons, given that the strings to be tested are given?

dynaweb

  • <b>Canine Deamon</b>
  • Administrator
  • Sr. Member
  • *****
  • Posts: 493
  • Karma: +10/-0
  • Generic personal text here ...
    • MSN Messenger - danno_d_manno@yahoo.com
    • View Profile
    • DynaWeb Designs
    • Email
foreach help and one line help
« Reply #1 on: February 23, 2008, 02:17:10 PM »
Sounds like you are referring to PHP programming.  I do not think there would be a tutorial out there that would handle all that, but a PHP programmer could do this no problem (me).  If you want to hire me or chat about it, MSN messenger me my username is danno_d_manno@yahoo.com (this is just my messenger username, do not try to contact me at that email address).
Those who cannot learn from history are doomed to repeat it. -- Linux learns.