Search Results

Search: Posts Made By: turk451
Forum: Programming 02-14-2012
1,382
Posted By turk451
Specify one argument to your script: find ....
Specify one argument to your script:

find . -name 'vdaq.txt' | xargs -n 1 vdaqconv
Forum: Programming 02-14-2012
1,382
Posted By turk451
Probably like: find . -name 'vdaq.txt' |...
Probably like:

find . -name 'vdaq.txt' | xargs vdaqconv
3,541
Posted By turk451
Oh ok no problem. Here are the changes...
Oh ok no problem. Here are the changes incorporated:

#!/usr/bin/perl -w

open (DATAFILE, $ARGV[0]) or die ("Could not open data file.");

print("Start Date, End Date, Start Time, End Time,...
3,541
Posted By turk451
For more complex text processing, I like to use...
For more complex text processing, I like to use Perl. If you have it installed in your environment, I found this to work on your initial data file:

#!/usr/bin/perl -w

open (DATAFILE, $ARGV[0])...
Forum: Solaris 12-07-2011
11,806
Posted By turk451
zaxxon's advice is correct if for some reason it...
zaxxon's advice is correct if for some reason it is a file compressed using gzip, but it was named with a ".zip" extension. However, it is worth mentioning that the error you encountered may also be...
Forum: Solaris 12-02-2011
2,613
Posted By turk451
Sure it's a valid point that if disk space max is...
Sure it's a valid point that if disk space max is being reached during sort, the same issue may be encountered while inserting into a DB. However, we don't really know all the details of the server....
Forum: Solaris 12-02-2011
2,613
Posted By turk451
Have you considered loading this data into a DB,...
Have you considered loading this data into a DB, and using SQL to select the records in a sorted way, then streaming it out to a file with identical structure as your original file?
11,901
Posted By turk451
Probably Perl if you have it. Here's the module:...
Probably Perl if you have it. Here's the module:

John McNamara / Spreadsheet-WriteExcel - search.cpan.org (http://search.cpan.org/dist/Spreadsheet-WriteExcel/)
1,613
Posted By turk451
I don't think it's a good idea to hack the...
I don't think it's a good idea to hack the history to implement another hack in your program.

The ARGV stuff should be easy. Just check the length of ARGV array to see if you got enough...
1,791
Posted By turk451
That seems efficient to me, but you may want to...
That seems efficient to me, but you may want to try xargs or something to simplify your script. What have you written to accomplish the task?
6,577
Posted By turk451
May work for you: find ~/modeling* -name...
May work for you:


find ~/modeling* -name "*.log"|xargs -ix bash -c "tac x|grep -m 3 -e ITER"
6,403
Posted By turk451
There is actually no check for the number "1"...
There is actually no check for the number "1" anywhere in the script. The "foreach" just iterates over all of the lines of the file, in order. The "if" statement checks to see if the line begins...
6,403
Posted By turk451
Got Perl? eturk-linux 20:13:50 (~/temp/pl)>...
Got Perl?

eturk-linux 20:13:50 (~/temp/pl)> cat filter.pl

#!/usr/bin/perl -w

open(IN,"dat.pdb") || die("Could not open infile!");
open(OUT,">new.pdb") || die("Could not open outfile!");
my...
4,458
Posted By turk451
I like Tyler's solution better :)
I like Tyler's solution better :)
4,458
Posted By turk451
Just one of a million Perl solutions: ...
Just one of a million Perl solutions:

#!/usr/bin/perl -w

open(IN,"out1.txt") || die("Could not open infile!");
open(OUT,">extract.txt") || die("Could not open outfile!");
foreach $line (<IN>)...
3,888
Posted By turk451
Well the issue is more or less this line: ...
Well the issue is more or less this line:


mv $1 /data2/harvest/


Because the mv command doesn't really know anything more than the destination directory you have specified. If you...
2,858
Posted By turk451
how about this?
A bit convoluted but it works on my system:


tr '\n' '|' < rules.dat | sed 's/|$//' | xargs -iRULE egrep -v RULE data.dat


1) Change newlines to pipes
2) Remove trailing pipe
3) Pass...
5,832
Posted By turk451
From: Bash Guide Guide for Beginners - Quoting...
From: Bash Guide Guide for Beginners - Quoting characters (http://www.linuxtopia.org/online_books/bash_guide_for_beginners/sect_03_03.html)

answer in bold:

Using double quotes the literal value...
2,169
Posted By turk451
Yeah, with the beginning and end of line special...
Yeah, with the beginning and end of line special characters, you are restricting the pattern effectively.

Glad to know it worked for you!
2,169
Posted By turk451
Let me give some output from your script to make...
Let me give some output from your script to make sure we're on the same page here:


eturk-linux 17:12:11 (~/bin)> ./test.pl
aaX
matches
eturk-linux 17:14:19 (~/bin)> ./test.pl
W1X
matches...
3,952
Posted By turk451
Hi Jeffers, I would probably pre-filter the...
Hi Jeffers,

I would probably pre-filter the data using shell commands. One command you could use just to count the number of unique users would be:

cut -f 4 -d',' data.dat | sort | uniq | wc...
2,346
Posted By turk451
grep -i -E 'error|warning' file
grep -i -E 'error|warning' file
3,952
Posted By turk451
Hi Jeffers, So to sum the values in the...
Hi Jeffers,

So to sum the values in the columns, you can modify the final print statement a bit like so, or sum it up in the main processing loop:


foreach (sort keys %resultsHash) {
...
3,952
Posted By turk451
Hi Jeffers, I made the changes that you had...
Hi Jeffers,

I made the changes that you had listed, and it worked fine for me:


#!/usr/bin/perl -w
use POSIX;

open (LOGFILE, $ARGV[0]) or die ("Could not open log file.");

foreach $line...
10,659
Posted By turk451
There are a couple areas for improvement of your...
There are a couple areas for improvement of your shell script. However, to address your primary concern, yes you can use variables in the find command. However, to allow those variables to be...
Showing results 1 to 25 of 34

 
All times are GMT -4. The time now is 03:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy