Re: [OT] Bash Script Help

2005-05-24 Thread Colin Ingram
Fred L Youhanaie wrote: Hi Colin, I have had to deal with this sort of things on quite a number of occasions, and I have my own little perl script, which is very similar to Paul's, mine came straight out of the perl cookbook ;-) If you replace Paul's last print statement with: print j

Re: [OT] Bash Script Help

2005-05-24 Thread Colin Ingram
Almut Behrens wrote: I assume I can make the first subexpression match zero or one time. In that situation if the first subexpression doesn't match does $1=null? ...exactly (though it's 'undef', not null, strictly speaking). And the nice thing is that Perl doesn't segfault or throw fat

[Fwd: Re: [OT] Bash Script Help]

2005-05-24 Thread Fred L Youhanaie
Apologies Colin, the reply was meant to go to the list :-( Fred L Youhanaie wrote: Hi Colin, Colin Ingram wrote: Paul Smith wrote: I was hoping to make this solution as simple as possible, so that my colleagues (most won't know perl or any other scripting language, but have experience wi

Re: [OT] Bash Script Help

2005-05-23 Thread Almut Behrens
On Mon, May 23, 2005 at 09:50:12PM -0500, Colin Ingram wrote: > Almut Behrens wrote: > > > > ... | perl -pe 's/^(\d+):(\d+):(\d+)/$1*60**2 + $2*60 + $3/e' > > > >in case the time string represents "hours:min:sec". > >If it's "min:sec.msec" (looks like it to me...), then it'd be > > > > > its actua

Re: [OT] Bash Script Help

2005-05-23 Thread Colin Ingram
Almut Behrens wrote: On Mon, May 23, 2005 at 04:17:44PM -0500, Colin Ingram wrote: (...) this creates a file that looks like this: 00:00.000, 3.24557e+007 00:02.510, 3.23482e+007 00:05.007, 3.24578e+007 00:07.507, 2.77091e+007 ---snip--- I now need to covert the "elapse time" column from t

Re: [OT] Bash Script Help

2005-05-23 Thread Colin Ingram
Paul Smith wrote: %% Colin Ingram <[EMAIL PROTECTED]> writes: ci> This is not a debian specific question but I thought some of you ci> could help. I am writing a shell script to parse a CSV file Why would you choose bash to do this? The shell is great for running commands, but it's really

Re: [OT] Bash Script Help

2005-05-23 Thread Paul Smith
%% Colin Ingram <[EMAIL PROTECTED]> writes: ci> This is not a debian specific question but I thought some of you ci> could help. I am writing a shell script to parse a CSV file Why would you choose bash to do this? The shell is great for running commands, but it's really poor at parsing tex

Re: [OT] Bash Script Help

2005-05-23 Thread Marty
Colin Ingram wrote: This is not a debian specific question but I thought some of you could help. I am writing a shell script to parse a CSV file to prepare it for input into a program which will fit the data by a non-linear least squares fitting routine. This program takes input from a file

Re: [OT] Bash Script Help

2005-05-23 Thread Almut Behrens
On Mon, May 23, 2005 at 04:17:44PM -0500, Colin Ingram wrote: > (...) > > this creates a file that looks like this: > 00:00.000, 3.24557e+007 > 00:02.510, 3.23482e+007 > 00:05.007, 3.24578e+007 > 00:07.507, 2.77091e+007 > ---snip--- > > I now need to covert the "elapse time" column from the strin

[OT] Bash Script Help

2005-05-23 Thread Colin Ingram
This is not a debian specific question but I thought some of you could help. I am writing a shell script to parse a CSV file to prepare it for input into a program which will fit the data by a non-linear least squares fitting routine. This program takes input from a file containing two column