Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. polka4ever

    how to say, zip code Starts With

    Thank you much for the tips! This worked great. So, once again coming from the SQL point of view - what if i have SEVERAL zip codes that i'm looking for? what if i want to say, If $ZipPlus4 has a value in ('29626', '29627', '29628', '29788') then increment $n += 1, and if it's NOT in those...
  2. polka4ever

    how to say, zip code Starts With

    hello, I am more of an SQL person - so what I am trying to say, I am not sure how to say in Perl. I am sure it is some sort of regular expression. Maybe YOU can help me! I would like to say, if ($ZipPlus4 STARTS WITH 29626) then increment n. any hints? thank you!
  3. polka4ever

    understanding Hashes

    thank you Ishnid :-) very helpful and useful.
  4. polka4ever

    understanding Hashes

    thank you for the info! another question - do you find that you use Hashes often in your perl programming? I am understanding the concept as it's presented in the book - but not sure how i will apply it in-real-life.
  5. polka4ever

    understanding Hashes

    Hello! I am new to Perl and have been using it intermittently in a QA role. Mainly for parsing & testing tab delimited files. I am reading through the Learning Perl book & working through Chapter 5 right now which is a chapter on hashes. I am not sure I'm understanding a Hash on the large...
  6. polka4ever

    break out STDIN into single letters

    nice! thanks rharsh for the tip! any thoughts on how to break it up into groups of 5, putting a space in-between?
  7. polka4ever

    break out STDIN into single letters

    i just tried Cygwin, but i still can't copy and paste from the screen ... whats up with that?
  8. polka4ever

    break out STDIN into single letters

    HEY! can i ask another question? So i wrote out an decoder and an encoder. But with the encoder - i want the blocks to be spaced in groups of 5. So if i wanted to say "I wrote a perl to encode and decode" - the program would return this to me: KN4H5 CQ9C4 S5HCO 8HFCQ OFFC8 HFC instead of this...
  9. polka4ever

    break out STDIN into single letters

    holy crap! that *IS* simple :-) thanks Trojan and sorry for the scare ;-)
  10. polka4ever

    break out STDIN into single letters

    Hello! thank you so much for the valuable input. Forgive the slowness of my brain - this is not something I particularly EXCEL at (at least not yet - let's hope that changes). I *would* use the "tr" option - but it's only mentioned very briefly in 'Learning Perl' and I'm not sure I can really...
  11. polka4ever

    break out STDIN into single letters

    Hello, I am new to perl and working my way through the Learning Perl book. I'm only on page 37, so bear with me!!! I want to take STDIN and break it into letters. It's a decoder program. Like, for example, if someone types in: LC8Q4 CBDSN XQRHD NKJXB HR into STDIN ... it will come out as BECAR...
  12. polka4ever

    pull only rows where field 2 is 'WI' in tab-delimited file

    I bet it is very similar to what was posted for kre1973 ... except that I need the "WI" or "OR" or "NE" or whatever state I need to occur in field 2 - instead of, say, the last name field or something.
  13. polka4ever

    pull only rows where field 2 is 'WI' in tab-delimited file

    hello! I have a story problem for you. I have a tab-delimited file. The 2nd field is the "state" field, and I want to pull out of this file, and write to a NEW file, only the rows that have Wisconsin as their state. 'WI' I believe I need to use "split" but not sure how. This is how far I've...
  14. polka4ever

    Putting "awk" inside of perl, system `cmd`

    Thank you! Yes, I had posted something very similar & was still not able to do what I wanted, but this time I *believe* i've got it. I needed to "split", which I wasn't doing - so thank you for that hint. system "rm seq2"; $ps=`ps -ef | grep java`; print "$ps"; @pid=split /\s+/, "$ps"; print...
  15. polka4ever

    Putting "awk" inside of perl, system `cmd`

    hello, does perl allow/understand when i use AWK inside of a system command? I can't understand why this isn't working: $pid=`ps -ef | grep java | egrep -v grep | awk '{print $2}'`; print "$pid"; when i type: ps -ef | grep java | egrep -v grep | awk '{print $2}' at the command prompt itself...
  16. polka4ever

    load a System command into a Variable

    Thank you kevin! That makes perfect sense. I see it now. do you know why this: my $proc = `ps -ef | grep java3 | egrep -v grep | awk '{print $2}'`; print $proc; gives me the entire process information instead of JUST the process id?
  17. polka4ever

    load a System command into a Variable

    Hi columb, well, to be honest - the main reason is because I'm very much new to this - and really only know one way of doing it. I looked in my perl book for PIPE - and it's not in there. (It's the O'Reilly Learning Perl book). Is that more of an advanced function? Also, a question - this isn't...
  18. polka4ever

    load a System command into a Variable

    cool. thx for the help - there *should* be only 1 process id that is returned. I tried to really narrow it down by grepping 'java3' - which is VERY specific to this one process and no other running process should have this in its command. Also, the egrep -v should get rid of the grep pid. So...
  19. polka4ever

    load a System command into a Variable

    hello, i would like to load a system command into a variable. The system command is: system "ps -ef | grep java3 | egrep -v grep | awk '{print $2}'"; I'm guessing the way I would do this is: my $proc = system "ps -ef | grep java3 | egrep -v grep | awk '{print $2}'"; But i have a question...
  20. polka4ever

    incorrect Results - Looping through Files & substr ()

    KevinADC, OK that worked like a charm. Wow. I'm impressed. i'm not totally sure how that was constructed or how you knew to do it that way - but I am studying it, to see if I can make more sense of it. Here's another little complication, what if I want it to be like - in the housenumber range...

Part and Inventory Search

Back
Top