No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
16 Posted Topics
| |
Below code snippet when executed from within a perl script, gives only $datetime."12/31/9999,AUTO,.$datetime as ouput. my $datetime=`date "+%D %r"`; open(FIN,"<$file_in") or die $!."\n"; open(FOUT,">$file_out") or die $!."\n"; my @lines=<FIN>; close(FIN); foreach(@lines){ $msg=$_; chomp($msg); $msg=$msg.",".$datetime.",12/31/9999,AUTO,".$datetime; print FOUT $msg."\n"; } close(FOUT); If i remove the chomp though, it gives me the line … | |
Re: Try this. Using a hash and sorting by value #!/opt/local/bin/perl5 my $in="in"; my $out="out"; my $line; my $text; my @sentences; my %seen; open(SOURCE,"<in") or die $!."\n"; while ($line = <SOURCE>) { chomp($line); $text = $text.$line; } close(SOURCE); @sentences = split(/[!,?,.]/, $text); foreach(@sentences){ my $dummy=$_; $dummy=~s/^\s//g;##removing any beginning space $seen{$dummy}=scalar(split(/\s+/,$dummy)); } … | |
[CODE] #!opt/local/bin/perl5 use strict; use Spreadsheet::ParseExcel; use XLSX.pm; my $oExcel = new Spreadsheet::ParseExcel; die "You must provide a filename to $0 to be parsed as an Excel file" unless @ARGV; my $oBook = $oExcel->Parse($ARGV[0]); my($iR, $iC, $oWkS, $oWkC); print "FILE :", $oBook->{File} , "\n"; print "COUNT :", $oBook->{SheetCount} , "\n"; … | |
I want to know what exactly a DBreorg does.My understanding is that it recalculates the data distributions based on index. But how is this different from a update stats on a table? I understand that we have two types of reorg 1)online and 2)offline. Whats the differnce? Apologies, I dunno … | |
Re: [QUOTE=;][/QUOTE] Looks to me liek you are trying to compare DNA sequences.. in that case will it be correct to assume that the character sets will all be of length 3? Also i suspect these files would run into millions of rows then? | |
Re: if you have a large number of blakclisted entrie (blacklist=1), adding an index on that column will help your query time. And as smantscheff suggested do a grep -v -f file_containg_patterns filecontaining_output(or sed '/pattern/d') to exclude the unwanted email patterns. | |
Re: [QUOTE=;][/QUOTE] what's wrong with backticks? `sort ...` | |
Hi, Am trying to copy all the directories alone within a directory. I tried something like [CODE] ls -ltr | awk '$1 ~/^d/{print $8} ' | xargs cp -r dest_dir [/CODE] the first part [CODE]ls -ltr | awk '$1 ~/^d/{print $8} ' [/CODE] gives O/P Testing But it keeps saying … | |
![]() | Re: who -Tu | awk '$7 !~ /\./ {print $1 , $8}' | sort -u ![]() |
Re: Should not be trying to open and close files if you can help it. [CODE] `cut -f 1 file> Data1`; [/CODE] and so on.. then do a sed to remove the first two lines of all the Data(num) files. | |
I want to remove blank lines (empty or with spaces and tabs) from a file from within a perl script. here's what i tried. [CODE]`sed '/^ *\$/d' $file1`;[/CODE] Does not seem to work for some reason. Any Help please? | |
Re: [CODE] SELECT productID,totalAmountAfter,transactionDate FROM( SELECT * from tbltransaction WHERE transactionDate BETWEEN '2010-01-01' AND '2010-12-31' ) A having A.transactionDate =max(A.transactionDate ) [/CODE] Should work | |
Hi, Is there a way i can pass variable column names to a stored proc? Here's what i want to do: i have lots of tables and for each of those i want to select out a few columns. e.g from table titles i want to pick out title_name and … | |
Hi i want to grep for two different patterns in the same file and diff the results(without needing to store them) I amnot able to get diff to accept the output of the two greps as arguments. Any help? Thanks for your time. | |
Hi, I want to ftp a file to a location and then kickstart a process there to work on the file. I tried using !rexec but it does not seem to be working too well. I am not using the .netrc file(if that helps you understand my problems better) Thanks … |
The End.