Re: [CentOS] Conversion of text in shell

2007-10-15 Thread mouss
Ross S. W. Walker wrote: > As it turns out this was a CS class exercise in using sed and regex. > > And excuse me, but you ARE using regular expressions in your example... > very true indeed... time to go to bed ;-p ___ CentOS mailing list CentOS@cen

Re: [CentOS] Conversion of text in shell

2007-10-15 Thread Ross S. W. Walker
ct: Re: [CentOS] Conversion of text in shell Ross S. W. Walker wrote: > Ross S. W. Walker wrote: >> roland hellström wrote: >>> OK! I finally figured out the solution for all you people out >>> the eager to hear it!!! >>> it was infact very very similar to the las

Re: [CentOS] Conversion of text in shell

2007-10-15 Thread mouss
Ross S. W. Walker wrote: > Ross S. W. Walker wrote: >> roland hellström wrote: >>> OK! I finally figured out the solution for all you people out >>> the eager to hear it!!! >>> it was infact very very similar to the last line I sent... >> this is it >>> sed 's/\([^\.]*\).\([^,]*\),\([^\.]*\).\([^

Re: [CentOS] Conversion of text in shell

2007-10-15 Thread Ralph Angenendt
roland hellström wrote: > > And btw it is not a homework project, it is simply some excercises to help us > learn :) Could you also please learn on how to not abuse a mail program - meaning: Teach your program to *not* break all quotations from previous mails into a single line (2008 characters

Re: [CentOS] Conversion of text in shell

2007-10-14 Thread William L. Maltby
On Fri, 2007-10-12 at 17:15 -0400, Marko A. Jennings wrote: > On Fri, October 12, 2007 4:54 pm, roland hellström wrote: > > > Assuming that you have those lines in a file called numbers.txt, you can > execute the following (all on one line): > > cat numbers.txt | tr '.,e' ',^^' | awk -F^ '{printf

RE: [CentOS] Conversion of text in shell

2007-10-12 Thread Ross S. W. Walker
Ross S. W. Walker > > Ross S. W. Walker wrote: > > > > roland hellström wrote: > > > > > > OK! I finally figured out the solution for all you people out > > > the eager to hear it!!! > > > it was infact very very similar to the last line I sent... > > this is it > > > sed 's/\([^\.]*\).\([^,]*

Re: [CentOS] Conversion of text in shell

2007-10-12 Thread John R Pierce
Ross S. W. Walker wrote: Ross S. W. Walker wrote: roland hellström wrote: OK! I finally figured out the solution for all you people out the eager to hear it!!! it was infact very very similar to the last line I sent... this is it sed 's/\([^\.]*\).\([^,]*\),\([^\.]*\).\([^

RE: [CentOS] Conversion of text in shell

2007-10-12 Thread Ross S. W. Walker
Ross S. W. Walker wrote: > > roland hellström wrote: > > > > OK! I finally figured out the solution for all you people out > > the eager to hear it!!! > > it was infact very very similar to the last line I sent... > this is it > > sed 's/\([^\.]*\).\([^,]*\),\([^\.]*\).\([^e]*\)e\(.*\)/\1,\2 >

RE: [CentOS] Conversion of text in shell

2007-10-12 Thread Ross S. W. Walker
roland hellström wrote: > > OK! I finally figured out the solution for all you people out > the eager to hear it!!! > it was infact very very similar to the last line I sent... this is it > sed 's/\([^\.]*\).\([^,]*\),\([^\.]*\).\([^e]*\)e\(.*\)/\1,\2 > \& $\3,\4 \\cdot 10^{\5}$/' > > omg I

RE: [CentOS] Conversion of text in shell

2007-10-12 Thread roland hellström
uring that out myself lol Thx for the help all :) ----> Subject: RE: [CentOS] Conversion of text in shell> Date: Fri, 12 Oct 2007 17:57:54 -0400> From: [EMAIL PROTECTED]> To: centos@centos.org>> roland hellström wrote:>>>> Indeed

RE: [CentOS] Conversion of text in shell

2007-10-12 Thread roland hellström
> Subject: RE: [CentOS] Conversion of text in shell> Date: Fri, 12 Oct 2007 17:57:54 -0400> From: [EMAIL PROTECTED]> To: centos@centos.org>> roland hellström wrote:>>>> Indeed this is a chalmers student. The purpose of

RE: [CentOS] Conversion of text in shell

2007-10-12 Thread Ross S. W. Walker
roland hellström wrote: > > Indeed this is a chalmers student. The purpose of asking > though is to learn it, because I find it very hard to learn > without seeing an example of it. > Thx for the reply it seemed to work well :) Although it would > be interesting to see if this could be done wit

RE: [CentOS] Conversion of text in shell

2007-10-12 Thread roland hellström
And btw it is not a homework project, it is simply some excercises to help us learn :) > Subject: RE: [CentOS] Conversion of text in shell> Date: Fri, 12 Oct 2007 17:29:13 -0400> From: [EMAIL PROTECTED]> To: centos@centos.org>> Marko

RE: [CentOS] Conversion of text in shell

2007-10-12 Thread roland hellström
advance > Subject: RE: [CentOS] Conversion of text in shell> Date: Fri, 12 Oct 2007 17:29:13 -0400> From: [EMAIL PROTECTED]> To: centos@centos.org>> Marko A. Jennings wrote:>>>> On Fri, October 12, 2007 4:54 pm, roland hellst

RE: [CentOS] Conversion of text in shell

2007-10-12 Thread Ross S. W. Walker
Marko A. Jennings wrote: > > On Fri, October 12, 2007 4:54 pm, roland hellström wrote: > > > > Hi! I want to convert the lines > > 1.1,3.19e-4 > > 1.2,3.05e-3 > > 10.5,9.14e8 > > (as example) > > > > to > > > > 1,1 & $3,19 \cdot 10^{-4}$\\ > > etc.. from one file and save these in a new file > > R

Re: [CentOS] Conversion of text in shell

2007-10-12 Thread Marko A. Jennings
On Fri, October 12, 2007 4:54 pm, roland hellström wrote: > > Hi! I want to convert the lines > 1.1,3.19e-4 > 1.2,3.05e-3 > 10.5,9.14e8 > (as example) > > to > > 1,1 & $3,19 \cdot 10^{-4}$\\ > etc.. from one file and save these in a new file > Rly lost here except I know I should use regexp and MAY