Loading ...
Sorry, an error occurred while loading the content.
 

Re: Can anyone help me!

Expand Messages
  • Damien Carbery
    ... Please provide us with the code you have written so far. You post gives me the impression that you have some code written. If you want a solution you can
    Message 1 of 2 , Feb 21, 2007
      --- In perl-beginner@yahoogroups.com, "Vivek Kumar"
      <kumarvivek_2001@...> wrote:
      >
      > Hi All,
      > I am new to Perl, Currently I'm facing on problem. I used to run
      > perl programs on Windows. I don't know how to write a code: which
      > will extract the last line of an output generated by a command. the
      > command is related to query on Windows Registry.
      >
      > Usually We used to query the Valuename for the given Key or subkey,
      > using the following command, in the command prompt.
      > C:\Documents and Settings\ccd1101>reg query
      > HKLM\SOFTWARE\Google\NavClient /v installtime
      >
      > And in the console it gives an output like this:
      >
      > ! REG.EXE VERSION 3.0
      >
      > HKEY_LOCAL_MACHINE\SOFTWARE\Google\NavClient
      > installtime REG_SZ 1148018321
      >
      > But I am not able to know how to extract the last line, May be the
      > last line is a balnk line or the last line is
      > installtime REG_SZ 1148018321
      >
      > I am interested in extracting the last value that is 1148018321, It
      > is the 'Value data', we call it in registry while installtime is
      > the 'Value name' that I can get using split, but how to get the
      > last printed line not the last blank line,is the major concern.
      >

      > Please provide me a solution.
      Please provide us with the code you have written so far. You post
      gives me the impression that you have some code written.
      If you want a solution you can ask at jobs.perl.org and pay someone.

      Here is some pseudo code for free:
      - Capture the output of 'reg query' into a list.
      - grep for the 'installtime' line into a new list
      - split the last element of that new list to get the data.
    Your message has been successfully submitted and would be delivered to recipients shortly.