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 strongm 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. howdthattaste

    controlling external programs/commands

    thanks stevexff, basically, the app i want to call starts some server stressing. It wont stop until the user presses 'e'. I want my perl script to initiate the stressing, then do some log checking, etc, then tell the app to stop so i can move on to the next server. i thought the 'pause'...
  2. howdthattaste

    controlling external programs/commands

    OS:Win Xp My example here seems pointless, but the method (if possible) would solve my problem. In windows, we have the command 'pause'. Its simple, and usually used at the end of batch files. You can also type it on the command line. At which point you're prompted to "press any key to...
  3. howdthattaste

    Convert serial [date] to text [date]

    that would make a great FAQ, and also include how to switch back. (ie. from 10/28/2006 to 54321) Also to note incase someone does an faq, ms sql has a DATEADD() function which seems to calculate differently than excel. we might want to include different distinctions of epoch and how to adjust...
  4. howdthattaste

    Convert serial [date] to text [date]

    actually, excel is getting it wrong. 39016 should convert to 10/28/2006 (if starting from 01/01/1900) ---------------------------------- "Not New York..., Kansas
  5. howdthattaste

    Convert serial [date] to text [date]

    how do I pass perl 39016 and convert it to 10/26/2006 ? (similar to excel's DATEVALUE function.) Is there a function or variation on localtime() to do this? i have this feelign i need to add some padding zero's to begging or end... thanks in advance ---------------------------------- "Not New...
  6. howdthattaste

    matching on mulitple lines

    thanks guys, i believe the $wrapped_line script is going to do it... the replace/one line versions simply "display" what im looking for, im really in need of processing that entire line. i probably didn't make that too clear anyway. but thanks! ---------------------------------- "Not New...
  7. howdthattaste

    matching on mulitple lines

    hello, i have an interesting question, which, knowing perl, is probably summed up in nice easy to implement function already hammered out ages ago. the question (which isn't that helpful at first) is: how do i match on multiple lines? for example if we have the lines: 0001233 - [this is text...
  8. howdthattaste

    perl one line string replacement (mulitple?)

    thanks for the link. actually, its pretty easy now that i think about it months later: c:\> type *.txt | perl -ple "s/dog/cat/g;" that webpage is very technical, but i call my verion the 'type and pipe'. it gets the job done, but the type command prints the filenames and some extra newlines...
  9. howdthattaste

    FTP Timeout option

    thanks for the suggestion, but i don't yet see how this is much different than using unless(). also a few things: if(substr($errmsg,0,7) == "Timeout") "Timeout" isn't numeric, should be 'eq' instead, but i get the idea. (its probably better to do 'if($errmsg =~ /Timeout/)' if i wanted to check...
  10. howdthattaste

    FTP Timeout option

    unfortunately, its hard to recreate the timeout. like i said, it "seems" it died. im not really sure if it actually dies or it a timeout issues a disconnect or something. so i got smart and set my timeout to 1 second and setup my filelist to only try to get the largest files (which are max...
  11. howdthattaste

    FTP Timeout option

    Hello, I have a script that will run through a list of filenames to get() from the ftp site. The ftp site is known for being unreliable at times. I need a way to skip over a file that is taking to long (or there was an error) and retry it later. I thought that if the timeout limit expired, it...
  12. howdthattaste

    sorting by multiple columns

    hello, maybe its just me, (well im pretty sure its just me) but i'm having a hard time trying to figure out the best way to sort a particular text file. sample race data: (name,sex,state,secs) Sally,female,indiana,26,23443 Mike,male,ohio,23,23423 Jim,male,indiana,29,12355 etc... so lets say...
  13. howdthattaste

    perl one line string replacement (mulitple?)

    nice! i probably should said that from the start. my first attempt in my original post was very close to feherke's. duh. semicolon. anyway, thanks, this all leads up to my next question, which is how do i do this: c:\> perl -ple "s/dog/cat/g;s/store/shop/g" *.txt > new.txt on multiple files...
  14. howdthattaste

    perl one line string replacement (mulitple?)

    oh! good point. but two separate statements wouldn't be a one-liner would it? im using windows so it would be like this: c:\> perl -nle "print if s/dog/cat/g;" text.txt > new.txt but, how do i do both dog/cat as well as store/shop is what im asking. "Not New York, Kansas
  15. howdthattaste

    perl one line string replacement (mulitple?)

    yeah, that works. i was actually looking for a one-line, one regexp. i thought there might be a shorter syntax than using "&&", but i guess thats efficient enough. thanks guys! "Not New York, Kansas
  16. howdthattaste

    perl one line string replacement (mulitple?)

    right, thanks. but i was looking for a one-liner type approach. via a script, since its just two items, i could use a list. but since its only 2, i feel it falls on that line between one-liner or script. i really dont want to have to write another script. but anyway, thank you very much for...
  17. howdthattaste

    perl one line string replacement (mulitple?)

    hello is there a way to do multiple string replacements in one line? sentence: "The dog ran into the dog store." rule: Always replace 'dog' with 'cat' and always replace 'store' with 'shop' my guess: $string =~ s/dog/cat/store/shop/g; something like that... I guess, if its possible, im...

Part and Inventory Search

Back
Top