help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: opening txt-file,script under octav


From: Sergei Steshenko
Subject: Re: opening txt-file,script under octav
Date: Wed, 2 May 2012 12:42:28 -0700 (PDT)


--- On Wed, 5/2/12, kathy_plotnikova <address@hidden> wrote:

> From: kathy_plotnikova <address@hidden>
> Subject: opening txt-file,script under octav
> To: address@hidden
> Date: Wednesday, May 2, 2012, 12:18 PM
> Hello dear everyone!
> 
> Let me aplogyse please for my level of aknoweledge. I am
> very new in Octav,
> and previosly I have never written a script, but now I have
> a lot of data so
> I really have to do it.
> In my script I need to create an array with data from the
> 9th row of every
> data file I have. So first of all I tried to work with one
> file, called
> k1.csv. Thus I wrote script called palscol.sh:
> 
> #!/bin/bash
> #include <stdio.h>
> fid = fopen('k1.csv','rt');
> Z = textscan(fid,9);
> fclose(fid);
> echo "Z is $Z";
> 
> But I got an error
> 
> ./palscol.sh: line 3: syntax error near unexpected token
> `('
> ./palscol.sh: line 3: `fid = fopen('k1.csv','rt');'
> 
> I spent almost all day trying to go throught this but
> unsuccessfully..
> So I will be extremelly glad if you will find a little time
> to have a look.
> And also, is it possible to work wirk with txt data files
> instead of csv
> data files?
> 
> Best regards,  
> Kathy, Master Student in the General Physics Institute,
> Moscow.
> 
> 
> --

Well, the

#!/bin/bash

part indicates that you want to program in 'bash'.

The

#include <stdio.h>

says "C" or C++ is meant.

The

fid = fopen('k1.csv','rt');
Z = textscan(fid,9);
fclose(fid);


part looks like Octave.

The

echo "Z is $Z";

part looks like various shells (POSIX shell(bin/sh), 'bash', 'csh', etc.).


So, did you decide to check our sense of humor or grass in Moscow is good :) ?

...

Bob Dylan once wrote a great song: http://www.youtube.com/watch?v=4ByDs_PgkNk ; 
http://www.bobdylan.com/us/songs/what-was-it-you-wanted .

Regards,
  Sergei.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]