Re: shell script problem (was: Re: [OT] rearranging data files)

2002-06-08 Thread Derrick 'dman' Hudson
On Sat, Jun 08, 2002 at 07:14:03PM +0200, Jörg Johannes wrote: | > Hm. | > | > If | > ./col2row.sh | > gives "Keine Berechtigung", but this one works: | > sh ./col2row.sh | > | > then you most likely put the script on a filesystem that has been | > mounted with the "noexec" attribute. Som

shell script problem (was: Re: [OT] rearranging data files)

2002-06-08 Thread Jörg Johannes
> Hm. > > If > ./col2row.sh > gives "Keine Berechtigung", but this one works: > sh ./col2row.sh > > then you most likely put the script on a filesystem that has been > mounted with the "noexec" attribute. Sometimes people mount /tmp this > way. Another test of this would be to copy /bin/l

Re: [OT] rearranging data files

2002-06-07 Thread Derrick 'dman' Hudson
On Fri, Jun 07, 2002 at 09:05:06AM -0400, Andrew Perrin wrote: | Ha! Perl 1, Python 0 | | (Sorry, couldn't resist.) ;-). | On Fri, 7 Jun 2002, Joerg Johannes wrote: | | > Am Freitag, 7. Juni 2002 01:21 schrieben Sie: | > Thank you, Matias, for your reply. I tried out your script, but I get

Re: [OT] rearranging data files

2002-06-07 Thread Andrew Perrin
Ha! Perl 1, Python 0 (Sorry, couldn't resist.) ap -- Andrew J Perrin - http://www.unc.edu/~aperrin Assistant Professor of Sociology, U of North Carolina, Chapel Hill [EMAIL PROTECTED] * andrew_perrin (at) unc.edu On Fri, 7

Re: [OT] rearranging data files

2002-06-07 Thread Joerg Johannes
Am Freitag, 7. Juni 2002 01:21 schrieben Sie: Thank you, Matias, for your reply. I tried out your script, but I get the following error when using it: [EMAIL PROTECTED]:~/test$ ./datenumkehr.py jo-001.asc Traceback (most recent call last): File "./datenumkehr.py", line 14, in ? if float(nu

Re: [OT] rearranging data files

2002-06-06 Thread Sridhar M.A.
On Thu, Jun 06, 2002 at 09:30:30PM +0200, Joerg Johannes wrote: > > and vice-versa. I need something that makes "Search and replace two spaces by a \newline" > and afterwards a bit of rectangle-editing in emacs obsolete. > Do not know for sure whether such a program exits. But you ca

Re: [OT] rearranging data files

2002-06-06 Thread Matias Hermanrud Fjeld
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thursday 06 June 2002 21:30, Joerg Johannes wrote: > At university, we have an old spectro-photometer, that spits out its data > in ASCII formatted files. The problem is, The data I get is sorted in lines > rather than in columns (See examples below

Re: [OT] rearranging data files

2002-06-06 Thread Karl E. Jorgensen
On Thu, Jun 06, 2002 at 09:30:30PM +0200, Joerg Johannes wrote: > Hi list > > At university, we have an old spectro-photometer, that spits out its data in > ASCII formatted > files. The problem is, The data I get is sorted in lines rather than in > columns (See examples > below). Is there a prog

Re: [OT] rearranging data files

2002-06-06 Thread Andrew Perrin
Well I felt like procrastinating today, so here's a solution: #!/usr/local/bin/perl # pivot.pl - turn rows into columns while (<>) { chomp; s/^\s+//; push(@rows, [split(/\s+/,$_)]); } shift(@$_) for @rows; print join("\t", map(shift(@$_), @rows)), "\n" while (@{$rows[0]}); Note that

[OT] rearranging data files

2002-06-06 Thread Joerg Johannes
Hi list At university, we have an old spectro-photometer, that spits out its data in ASCII formatted files. The problem is, The data I get is sorted in lines rather than in columns (See examples below). Is there a progam (preferably command-line) that can do swap the rows to columns, and vice-v