--- In perl-beginner@yahoogroups.com, "Vivek
krishna"
<krishnavivek_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 Settingsccd1101>reg query
> HKLMSOFTWAREGoogleNavClient /v installtime
>
> And in the console it gives an output like this:
>
> ! REG.EXE VERSION 3.0
>
> HKEY_LOCAL_MACHINESOFTWAREGoogleNavClient
> 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.
Unsubscribing info is here: h
ttp://help.yahoo.com/help/us/groups/groups-32.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://g
roups.yahoo.com/group/perl-beginner/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http
://groups.yahoo.com/group/perl-beginner/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:perl-beginner-digest@yahoogroups.com
mailto:perl-beginner-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
perl-beginner-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.c
om/info/terms/
|