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...
User Profile
Collapse
-
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,
VijayarlLeave 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"; }
Regards,
VijayarlLeave a comment:
-
hi scruff6119,
my guess was right... am getting output like this
Code:prstat-Ls-LAVG-prstat-Ls-20080118-1800.xls
Code:prstat-Ls-LAVG-20080118-1800.xls
any help or idea ???
Regards,
VijayarlLeave 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
Code:$str=prstat-Ls-LAVG-prstat-Ls-20080118-1800.xls
Regards,
VijayarlLeave 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.
... -
Hi there,
Have you installed that module ???
Regards,
VijayarlLeave a comment:
-
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
Leave a comment:
-
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;
Leave a comment:
-
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.
VijayarlLeave a comment:
-
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.
Leave a comment:
-
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
Leave a comment:
-
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
Leave a comment:
-
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
Code:print "$data[12]\n" if(exists $data[12]); ##prints data if LAVG_1min value is found
Leave a comment:
-
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
Leave a comment:
-
hey nitinpes !!! thanks for your reply
i will try 2nd solution what u said ... right away
Regards,
VijayarlLeave a comment:
-
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);
Leave a comment:
-
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;
Leave a comment:
-
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
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
-
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,
VijayarlLeave a comment:
No activity results to display
Show More
Leave a comment: