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: *

  • Users: viadisky
  • Order by date
  1. viadisky

    Case Insensitive Search using GREP

    Hi MillerH/ishnid, Thanks for all the suggestions you provided. I was able to create the script I needed and at the same time I applied the same concepts to other scripts I'm doing. Knowledge of both Perl and REGEX is very useful :-) Regards viadisky
  2. viadisky

    I can't use EGREP

    Thanks for all the information :-) I'm currently learning REGEX using and most of the examples in the book I'm using have egrep. I'm using the code I posted earlier to simulate examples in the book. Thank you again. Regards viadisky
  3. viadisky

    I can't use EGREP

    Hi, I'm currently running this version of Perl in my MS Windows XP machine. This is perl, v5.8.8 built for MSWin32-x86-multi-thread (with 33 registered patches, see perl -V for more detail) Copyright 1987-2006, Larry Wall Binary build 819 [267479] provided by ActiveState...
  4. viadisky

    Case Insensitive Search using GREP

    Thanks again! I used this instead .. print OUT @result; Regards viadisky
  5. viadisky

    Case Insensitive Search using GREP

    Hi ishnid, Thank you very much for your suggestion. It worked!!! I added something that would make the script dump the output to a text file instead. Is there an easy way of dumping what is inside an array to a text file? I used "foreach" loop in this case. #!C:\Perl\bin\perl.exe open (FILE...
  6. viadisky

    Case Insensitive Search using GREP

    Hi, I created a very basic Perl script that can grep item inside a file and display the result on the screen. #!C:\Perl\bin\perl.exe open (FILE, '<Fruits.txt')or die "$!\n"; @array = <FILE>; @result = grep (/apple/, @array); print @result; close (FILE); Fruits.txt contains these lines...
  7. viadisky

    Looking for standard lines inside file using REGEX

    Hi travs69, Thanks for your help. Can you please give basic example how to use regexp? Regards Maria
  8. viadisky

    Looking for standard lines inside file using REGEX

    Hi Spookie, Thanks for the suggestion you provided :-) But this REGEX matched the file with these lines: ip name-server 172.21.204.33 ip name-server 172.21.204.34 ip name-server 1.1.1.12 That's why I had to type the exact IP Addresses to have 100% match. Regards vaidisky
  9. viadisky

    Looking for standard lines inside file using REGEX

    Hi, I need the help of all regex gurus out there. Listed below are standard lines I need to check inside a file. A file should be okay if all these lines can be found and in the right order. ip name-server 4.3.2.1 ip name-server 3.2.3.2 ip name-server 1.1.1.1 I created a very basic REGEX to...
  10. viadisky

    Look for standard lines inside a file using REGEX

    Ooppsss, i had typo error in my previous email (sorry) ip name-server 4.3.2.1 ip name-server 3.2.3.2 ip name-server 1.1.1.1 I created a very basic REGEX to do this: ^ip name-server 4\.3\.2\.1$ ^ip name-server 3\.2\.3\.2$ ^ip name-server 1\.1\.1\.1$
  11. viadisky

    Look for standard lines inside a file using REGEX

    Hi, I need the help of all regex gurus out there. Listed below are standard lines I need to check inside a file. A file should be okay if all these lines can be found and in the right order. ip name-server 4.3.2.1 ip name-server 3.2.3.2 ip name server 1.1.1.1 I created a very basic REGEX to...
  12. viadisky

    grep portion of a string using sed

    Ooopss ... I forgot there is a small note that Feherke added in his posting ... "The second solutions will not work well if there are input lines without that markup. Specify more about the input format if needed." I will try a different approach ....
  13. viadisky

    grep portion of a string using sed

    Hi, I submitted this query before and Feherke kindly provided solution: (thread822-1198142) I'm trying to use the same sed command to format my data but I think I missed something because it's not providing the result I'm expecting. My original data looks like this: MRTG$ grep -i "System"...
  14. viadisky

    printing lines using awk

    Hi Feherke, Thanks for the additonal help you provided :-) Cheers!
  15. viadisky

    printing lines using awk

    Both PHV's and Feherke's suggestions are both correct !!! Thanks ...!!! The only thing I need to do before using the script is that no data is missing because if one "In" data is missing .. the computation will be wrong. The data I need to work on is shown below and as you can see I have...
  16. viadisky

    printing lines using awk

    I search in google for a free tutorial on this side of awk (putting data in an array) but most tutorial I've seen are showing basic examples ... I tried to change some portion of the script given by PHV (I find it easier to modify his script because he included the computation already) and I...
  17. viadisky

    printing lines using awk

    Both Feherke's and PHV's codes worked if I use "nawk"... PHV's script has the actual computation results but it only shows in "In" data ... ifInOctets_26Jan2007_12:25:00_10_s1/6-ifInOctets_26Jan2007_12:20:00_10_s1/6-->384509644-384506513=3131...
  18. viadisky

    printing lines using awk

    Both Feherke's and PHV's codes worked if I use "nawk"... PHV's script has the actual computation results but it only shows in "In" data ... ifInOctets_26Jan2007_12:25:00_10_s1/6-ifInOctets_26Jan2007_12:20:00_10_s1/6-->384509644-384506513=3131...
  19. viadisky

    printing lines using awk

    Hi Feherke, Thank you so much for the additional information you provided. I also saw this basic example of NR%2 : awk 'NR % 2 == 0' file Looking at the first code you provided (this is still producing errors when I run it). I will try to undertsand it bit-by-bit so i can easily modify it...
  20. viadisky

    printing lines using awk

    Hi, I saw this in awk's manpage ... getline var --> reads the next record into var, updates NR and FNR. is there a way I can use this getline? Thanks ...

Part and Inventory Search

Back
Top