User Profile

Collapse

Profile Sidebar

Collapse
vijayarl
vijayarl
Last Activity: Oct 30 '08, 09:07 AM
Joined: Sep 5 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hi there,

    did u see this post:

    http://bytes.com/forum/thread845672.html

    i guess, your problem will get resolve if you try it out..

    But as said by nitinpes, you should try scripting yourself.if get struck then post the code here..people will help you out.

    -Vijayarl...
    See more | Go to post

    Leave a comment:


  • hey thanks scruff6119 !!!!

    Even this worked...As am not so good at regex.. i didn't thought of this idea..

    anyway's thanks for you help :-)

    Regards,
    Vijayarl
    See more | Go to post

    Leave a comment:


  • hi there,

    i got it...it was simply..
    Code:
    foreach my $f (@file){
    $str = substr($f,32,39);
    $str1 = substr($str,0,9);
    $str2 = substr($str,10,27);
    $str = $str1 . "-LAVG-" . $str2;
    $loadavg ="c:\\Performance_svap\\OUTPUT_FILES\\$str";
    }
    Thanks you...

    Regards,
    Vijayarl
    See more | Go to post

    Leave a comment:


  • hi scruff6119,

    my guess was right... am getting output like this
    Code:
    prstat-Ls-LAVG-prstat-Ls-20080118-1800.xls
    i instead want the file name to look like this:
    Code:
    prstat-Ls-LAVG-20080118-1800.xls
    thanks for your reply

    any help or idea ???

    Regards,
    Vijayarl
    See more | Go to post

    Leave a comment:


  • hey thanks for reply !!! i try it right away !!!

    but what i feel is what you have suggested will give this i guess :
    Code:
    $str1 = substr($str,0,9); # holds the value =prstat-Ls
    so i guess i will get this ouput from your logic
    Code:
    $str=prstat-Ls-LAVG-prstat-Ls-20080118-1800.xls
    anyway i will cm back !!!

    Regards,
    Vijayarl
    See more | Go to post

    Leave a comment:


  • Appending the required string between the variable(concatenation) ?

    Hi Everyone,

    i need to add a string in between the filename.so that new file will have the
    required filename.

    what am doing is reading the files from the directory & extract only the filename and then pass this failename to create new file.

    now what i need is instead of just passing filename, i need to add some string to this filename & then pass the filename to create a new file.
    ...
    See more | Go to post

  • vijayarl
    replied to YAML module issue
    in Perl
    Hi there,

    Have you installed that module ???



    Regards,
    Vijayarl
    See more | Go to post

    Leave a comment:


  • vijayarl
    replied to How to delete a line in excel file ???
    in Perl
    hi All,

    i got the required result.

    Thanks to nitinpes !!! i was almost given up... he came & gave me the right inputs..

    Working Script:
    Code:
    #!/usr/bin/perl -w 
    use strict; 
    use Spreadsheet::ParseExcel::Simple; 
    my $dir = 'C:\Performance_svap\INPUT_FILES\*.xls'; 
    my @file=glob("$dir"); 
    my @output;
    my $loadavg;
    my $str;
    my
    ...
    See more | Go to post

    Leave a comment:


  • vijayarl
    replied to How to delete a line in excel file ???
    in Perl
    Thanks nitinpes..... thanks for your patience reply...

    i have done almost expect for now, in the ouput file i get only last entry of data before in cmd prompt i got all the required data but now only one entry.

    really not getting what mistake i have made...:-(
    am not so good at programming so am asking help..

    can anyone help me ???

    Code:
    #!/usr/bin/perl -w 
    use strict;
    ...
    See more | Go to post

    Leave a comment:


  • vijayarl
    replied to How to delete a line in excel file ???
    in Perl
    Ahhh !!! sorry there was no semicolon at the end of open stmt....silly mistake..

    anyway's now this error, what it actually means:
    Code:
    use of uninitialized value in concatenation (.) or string at excel.pl line 56.
    Regards,
    Vijayarl
    See more | Go to post

    Leave a comment:


  • vijayarl
    replied to How to delete a line in excel file ???
    in Perl
    Hi nitinpes,

    i get this error when i try to run :
    Code:
    C:\Performance_svap\misc>perl excel.pl
    String found where operator expected at excel.pl line 55, near "EX "$data[0]\t$d
    ata[1]\t$data[12]\t$data[13]\t$data[14]\n""
            (Do you need to predeclare EX?)
    syntax error at excel.pl line 55, near "print"
    Execution of excel.pl aborted due to compilation errors.
    ...
    See more | Go to post

    Leave a comment:


  • vijayarl
    replied to How to delete a line in excel file ???
    in Perl
    Thanks Nitinpes for your help !!!!

    i got the desired result,now all i want is how to put this results into another excel file. as there will be more excel files need to read from the dir.

    Code:
    #!/usr/bin/perl -w
    use strict;
    use Spreadsheet::ParseExcel::Simple;
    my $dir = 'C:\Performance_svap\INPUT_FILES\*.xls';
    my @file=glob("$dir");
    my @output;my @outfile;
    foreach
    ...
    See more | Go to post

    Leave a comment:


  • vijayarl
    replied to How to delete a line in excel file ???
    in Perl
    thanks nitinpes for your kind reply...

    now i am almost getting the near the required result

    i ahve try to get the required data but problem ia with the DD/MM/YYYY & HH:MM:SS column data

    as soon as i get the value under LAVG_1min i need to fetch values of date & time from the same row.

    now what am getting is all the date & time in the output
    Code:
    #!/usr/bin/perl -w
    ...
    See more | Go to post

    Leave a comment:


  • vijayarl
    replied to How to delete a line in excel file ???
    in Perl
    nitinpes,

    i got the problem !!! there was slight error in this:
    Code:
     print "@data\n" if(exists $data[4]); ##prints data if LAVG_1min value is found
    it has to be :
    Code:
    print "$data[12]\n" if(exists $data[12]); ##prints data if LAVG_1min value is found
    now, i got the all the values under LAVG_1min column header & i guess i can fetch other required...
    See more | Go to post

    Leave a comment:


  • vijayarl
    replied to How to delete a line in excel file ???
    in Perl
    hai nitinpes,
    i did try out you way

    but it prints all the data present in the excel file

    ouput what i got after implementing what u said:
    Code:
    18/01/2008 18:36:00 133 root 4560K 816K sleep 59 0 0:00:00 0.0% picld/1
    18/01/2008 18:36:00 58 root 13M 5784K sleep 59 0 0:00:15 0.0% vxconfigd/1
    18/01/2008 18:36:00 24992 vappr 1217M 1044M sleep 29 10 0:00:00 0.0% java/53
    18/01/2008 18:36:00
    ...
    See more | Go to post

    Leave a comment:


  • vijayarl
    replied to How to delete a line in excel file ???
    in Perl
    hey nitinpes !!! thanks for your reply

    i will try 2nd solution what u said ... right away

    Regards,
    Vijayarl
    See more | Go to post

    Leave a comment:


  • vijayarl
    replied to How to delete a line in excel file ???
    in Perl
    ok.. now what i did is to search for the required header & put them under one array.
    Code:
    #!/usr/bin/perl -w
    use strict;
    use Spreadsheet::ParseExcel::Simple;
    my $dir = 'C:\Performance_svap\INPUT_FILES\*.xls';
    my @file=glob("$dir");
    my @output;
    foreach my $f (@file){
    print "$f\n";
            print "Processing $f please wait\n";
    		my $xls = Spreadsheet::ParseExcel::Simple->read($f);
    ...
    See more | Go to post

    Leave a comment:


  • vijayarl
    replied to How to delete a line in excel file ???
    in Perl
    Hi Everyone,

    going forward ,i did some scripting to read the data from the excel file & put the data into an array.

    (used Spreadsheet-ParseExcel-Simple-1.04 module from CPAN)

    full script: it just reads the data & puts them into array
    Code:
    use strict;
    #use Spreadsheet::ParseExcel;
    use Spreadsheet::ParseExcel::Simple;
    
    my $oExcel = new Spreadsheet::ParseExcel;
    ...
    See more | Go to post

    Leave a comment:


  • vijayarl
    started a topic How to delete a line in excel file ???
    in Perl

    How to delete a line in excel file ???

    Hi All,

    Requirement:

    i have 4 excel files, each file will have this line
    Code:
    18/01/2008 20:00:00			5.31	5.48	5.33
    i need to search for this line & extract this line then print it another excel file.

    INPUT file look like this:
    Filename:prstat-Ls-20080118-2000.xls
    Code:
    DD/MM/YYYY HH:MM:SS PID USERNAME LAVG_1min LAVG_5min LAVG_15min
    18/01/2008
    ...
    See more | Go to post
    Last edited by vijayarl; Oct 14 '08, 01:54 PM. Reason: code tag !!

  • vijayarl
    replied to List directory contents
    in Perl
    hi,

    and even if you want can go through this post :

    http://bytes.com/forum/thread844454.ht ml

    jeff has clearly explained how script works & even it avoid reading . & .. (dot & dot dot) contents from the directory.

    have a try !!!

    Regards,
    Vijayarl
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...