Main Page | Report Page

 

  Computers Forum Index » Computer Languages (IDL-PVWAVE) » Write a vector into a file...

Author Message
sravani vaddi...
Posted: Tue Nov 09, 2010 1:18 am
 
Hi,
Can somebody let me know how to write a vector into a file, and the
file should contain data only in one column
When i used the following code, it prints in some 4 x 3 matrix form.

openw, 1, 'jobs.csv'
printf, 1, jobs
close, 1

Thanks,
Sravani
 
Paulo Penteado...
Posted: Tue Nov 09, 2010 2:08 am
 
On Nov 8, 11:56 pm, David Fanning <n... at (no spam) dfanning.com> wrote:
Quote:
jeanh writes:
try the format keyword:
printf, 1, jobs, format = '(A)'

Alright, Jean, you are going to have to explain this one
to us. Smile

At this point we do not even know the vector's type or shape. So that
is not a bad guess, as it will try to stringify the vector's elements,
one per output line.
 
jeanh...
Posted: Tue Nov 09, 2010 6:17 am
 
On 08/11/2010 8:18 PM, sravani vaddi wrote:
Quote:
Hi,
Can somebody let me know how to write a vector into a file, and the
file should contain data only in one column
When i used the following code, it prints in some 4 x 3 matrix form.

openw, 1, 'jobs.csv'
printf, 1, jobs
close, 1

Thanks,
Sravani
Hi


try the format keyword:
printf, 1, jobs, format = '(A)'

Jean
 
David Fanning...
Posted: Tue Nov 09, 2010 6:17 am
 
jeanh writes:

Quote:
try the format keyword:
printf, 1, jobs, format = '(A)'

Alright, Jean, you are going to have to explain this one
to us. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
 
David Fanning...
Posted: Tue Nov 09, 2010 6:17 am
 
sravani vaddi writes:

Quote:
Can somebody let me know how to write a vector into a file, and the
file should contain data only in one column
When i used the following code, it prints in some 4 x 3 matrix form.

openw, 1, 'jobs.csv'
printf, 1, jobs
close, 1

Well, if "jobs" is some 4x3 matrixy thing, I'd
say IDL was just doing its job. :-)

Cheers,

David

P.S. It *is* a 4x3 matrixy thing, isn't it?


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
 
 
Page 1 of 1    
All times are GMT
The time now is Fri Aug 29, 2014 5:38 am