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 Mike Lewis 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. NesPes

    File printing

    Kevin The input file always has multiple sets of A1,A2,A3 but all of them are in the same order as shown in the example.
  2. NesPes

    File printing

    I have a very basic question on deleting/printing from/to a file. My input file is something like this: A1:This is the first line A2:Welcome to the first line A3:haaaaaaaaaaaaaaaaaaaaa A1:This is the first line A2:Welcome to the second line A3:heeeeeeeeeeeeeeeeeeeee I want to first...
  3. NesPes

    use of arrays

    Thanks Miller. I got it.
  4. NesPes

    use of arrays

    I changed my code a little bit. I am moving selective contents of the array into files (A1 and A2). I now want to process these files. But when i run the code, the control never goes to the while loop although i am able to see these files created. I am unable to understand this behaviour. Please...
  5. NesPes

    use of arrays

    I did not get you. I am trying this code in the elsif, but when i try to print the contents of array2, i see blank lines. Am i missing something? My Code: elsif($array[$num] =~ /Search string 2/) { for my $tnum(0) { print "$array[$num+$tnum]\n"; push...
  6. NesPes

    use of arrays

    I have modified your code to print based on two search parameters. To continue, i want to move 4 lines of code which are retrieved in the first part of the if statement to array1 and 1 line of code retrieved in the second part of the elsif statement to array2. Code: open(f1,"input.log")...
  7. NesPes

    use of arrays

    It works. Now i want to do additional processing on these 6 lines of code extracted. So i want to move these 6 lines again to a seperate array and somehow keep an index for these 6 lines so that when iam done with the first search, the pointer should again move to the first line of the next 6 lines.
  8. NesPes

    use of arrays

    I would like to copy an entire file in an array and search for a keyword "Search". When this keyword is found, i then want to copy next 6 lines from this keyword. This task needs to be repeated for the entire file. Can somebody guide me how to go about this? Thanks.
  9. NesPes

    Issue with Nested IF loops

    My task involves me to check for a particular string in a file and capture some part in a variable. I then have to use this variable value and search for the remainder part of the file. If it is found, i have to do some processing. It is much like any sorting example. So, i guess i cannot...
  10. NesPes

    Issue with Nested IF loops

    I have foll code: while (<G1>) { if ($_ =~ /Some/) { { do something; } -----> End first loop if ($_ =~ /More/) { do something; } } -----> End second loop } ----> End of while...
  11. NesPes

    Issue with Nested IF loops

    I face issues when i have nested if conditions. The code never goes to the second nested if loop. Any ideas/thoughts on this?
  12. NesPes

    Searching string in a file

    So far I have learnt how to traverse a file and search for given strings within a file.
  13. NesPes

    Searching string in a file

    The query on the other forum is similar to mine. But it seems to be pure coincidental to me. To answer again, this is not part of any school work, i am a working professional who is bent to learn perl to make life easier. I have nothing more to say. If you beleive me, please help me with my query.
  14. NesPes

    Searching string in a file

    I have not posted my query on any other forum. I do not know if some-one else has a similar question. As for me, i want to learn Perl and use it in my day-to-day work. It is not part of any school/class work. Thanks.
  15. NesPes

    Searching string in a file

    I would like to print scc.ecm.chip if the string ABCD is found in the file. Your inputs. `define ABCD `scc.ecm.chip Thanks in advance.
  16. NesPes

    Searching string in a file

    Thanks for the reply. I got it. I have one more doubt. i am trying to search for a string in a file which is defined as `define ABCD `AB.BC.DA I want to grep for the string ABCD in the file and if this is found, then the script should print AB+BC+DA Can you please help me on this?
  17. NesPes

    Searching string in a file

    i have a very basic question. Since i am new to Perl, i am unable to resolve this myself. Any help will be greatly appreciated. I am browsing through a file and searching for a string. If the string matches, i want to pick the next line. Somehow i am not able to move my file handler to the next...

Part and Inventory Search

Back
Top