SYLK files <--> IDL structure? [message #9357] |
Thu, 19 June 1997 00:00  |
William T.(Tom) Bridg
Messages: 1 Registered: June 1997
|
Junior Member |
|
|
Does anyone know of or have an IDL routine for reading/writing symbolic
link (SYLK) files? By SYLK I mean the text-like format supported by
many Mac & PC spreadsheet & database programs (there seems to be another
format it is occasionally confused with).
Thanks.
--
Tom Bridgman bridgman@grossc.gsfc.nasa.gov
NASA Goddard Space Flight Center 301-286-1346
Code 660.1
Greenbelt, MD 20771
|
|
|
Re: SYLK [message #56594 is a reply to message #9357] |
Mon, 05 November 2007 09:30   |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
I seem to remember that you can't write mixed types using write_sylk.
What you can do is modify the write_sylk function such that it does what
you need. It's pretty simple.
For example, A long time ago I had someone who really wanted to create
sylk files and also wanted to insert column headers. make_sylk was
born. You pass a structure:
dat={header:['x','y','z'], data:[1,2,3]}
And the structure is written to file from left to right. Tag names are
irrelevant. The contents of the first tag will be completely written,
then the contents of the second, and so on.
This may not be exactly what you are looking for but the point is that
the modifications are pretty simple. You'll of course need to pass the
data in as a struct, then figure our how you'll have to pick out the
data you need in the order you need it. write_sylk is in your idl "lib"
directory. Make a copy of it and have at it.
My version of make_sylk can be found here:
http://www.acoustics.washington.edu/~towler/programs/make_sy lk.pro
-Rick
Jeff wrote:
> Hi there...
>
> I'd like to know if I can use WRITE_SILK to save float and string data
> together.
> Suppose I have tw arrays:
>
> a=[1.2, 2.3, 4.5, 2.1]
> b=['a', 'b', 'c', 'd']
>
> Is it possible to join these arrays in one file using WRITE_SILK??
>
> Thanks!
> Julio
>
|
|
|
Re: SYLK [message #56600 is a reply to message #9357] |
Sun, 04 November 2007 05:58   |
Jeff[2]
Messages: 18 Registered: November 2007
|
Junior Member |
|
|
On 3 nov, 22:22, David Fanning <n...@dfanning.com> wrote:
> Jeff writes:
>> Don't worry. I'll keep trying to use IDL as a novice. And I'll be more
>> careful to post new messages in the group to get gentle instead of
>> arrogant answers.
>
> Look, you undoubtedly ran into some leftover heat
> from a disagreement I had earlier with my wife. So
> my apologies if I seemed overbearing. Misplaced anger,
> no doubt.
>
> But, this took me less than a minute to research:
>
> a = ['Col 1', 'Col 2', 'Col 3']
> b = [ 1, 2, 3]
> void = Write_SYLK('test.sylk, {a:a, b:b})
>
> If you have actually tried something and it didn't
> work, let us know. It will at least alert us to the
> fact that you are willing to do some work.
>
> 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.")
Ok David...
Thank you.
And my apologies too if I said something bad.
Best,
|
|
|
Re: SYLK [message #56603 is a reply to message #9357] |
Sat, 03 November 2007 18:22   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jeff writes:
> Don't worry. I'll keep trying to use IDL as a novice. And I'll be more
> careful to post new messages in the group to get gentle instead of
> arrogant answers.
Look, you undoubtedly ran into some leftover heat
from a disagreement I had earlier with my wife. So
my apologies if I seemed overbearing. Misplaced anger,
no doubt.
But, this took me less than a minute to research:
a = ['Col 1', 'Col 2', 'Col 3']
b = [ 1, 2, 3]
void = Write_SYLK('test.sylk, {a:a, b:b})
If you have actually tried something and it didn't
work, let us know. It will at least alert us to the
fact that you are willing to do some work.
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.")
|
|
|
Re: SYLK [message #56604 is a reply to message #9357] |
Sat, 03 November 2007 17:28   |
Jeff[2]
Messages: 18 Registered: November 2007
|
Junior Member |
|
|
On 3 nov, 20:05, "R.G. Stockwell" <noem...@please.com> wrote:
> "Jeff" <julio.esque...@gmail.com> wrote in message
>
> news:1194123434.528064.133470@o38g2000hse.googlegroups.com.. .
>
>> On 3 nov, 17:47, David Fanning <n...@dfanning.com> wrote:
>>> Jeff writes:
>>>> I'd like to know if I can use WRITE_SILK to save float and string data
>>>> together.
>
> I got quite a chuckle out of this exchange.
> Jeff, I hope you see David's point. You can cut and paste from
> your post to the IDL command line, and then tell us it worked.
> My guess is that you can do it.
>
> I'd also like to point out the obvious.
> A float array and a string array can be a single string array.
>
> Cheers,
> bob
Dear David,
I have tried to export my float data to SYLK format, just as a
spreadsheet, but I need to put variable names in each column. I don't
know how to merge these two data types.
I got very disappointed when I read you post, because I always
respected you and your posts have helped me before. Maybe my question
wasn't so clear and was too obvious to you. And you can surely call me
ignorant on IDL, because I'm not a programmer like you. But I know
the difference between ignorance and laziness. I have spent a lot of
time trying to solve this "easy" problem and I thought I could have
some tips on IDL Groups, with expert people.
Don't worry. I'll keep trying to use IDL as a novice. And I'll be more
careful to post new messages in the group to get gentle instead of
arrogant answers.
Best,
|
|
|
|
Re: SYLK [message #56607 is a reply to message #9357] |
Sat, 03 November 2007 14:50   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jeff writes:
> Surely it takes less time to ignore some easy question (to YOU) then
> to write something bad, doesn't it!?
I think it is a matter of historical record that I've
never been shy about answering all kinds of IDL questions.
(I've answered "DEVICE, DECOMPOSED=0" well over a million
times, if memory serves.) A great many of these questions
(more than you probably imagine) I don't know the answer
to. It is not unusual for me to spend as much as a hour
researching a question before I post a two paragraph
answer. This is how I've learned what I know about IDL.
But, I *don't* know the answer to this question. And I'm
not going to waste the 30 seconds it would take to find
out, either. I'd rather waste 10 minutes lecturing on
the difference between ignorance and laziness, and why
understanding the difference is important.
What have YOU done to answer this question?
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.")
|
|
|
Re: SYLK [message #56608 is a reply to message #9357] |
Sat, 03 November 2007 13:57   |
Jeff[2]
Messages: 18 Registered: November 2007
|
Junior Member |
|
|
On 3 nov, 17:47, David Fanning <n...@dfanning.com> wrote:
> Jeff writes:
>> I'd like to know if I can use WRITE_SILK to save float and string data
>> together.
>> Suppose I have tw arrays:
>
>> a=[1.2, 2.3, 4.5, 2.1]
>> b=['a', 'b', 'c', 'd']
>
>> Is it possible to join these arrays in one file using WRITE_SILK??
>
> Surely it takes less time to try it then to write the
> question, doesn't it!?
>
> 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.")
Surely it takes less time to ignore some easy question (to YOU) then
to write something bad, doesn't it!?
|
|
|
Re: SYLK [message #56609 is a reply to message #9357] |
Sat, 03 November 2007 13:47   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jeff writes:
> I'd like to know if I can use WRITE_SILK to save float and string data
> together.
> Suppose I have tw arrays:
>
> a=[1.2, 2.3, 4.5, 2.1]
> b=['a', 'b', 'c', 'd']
>
> Is it possible to join these arrays in one file using WRITE_SILK??
Surely it takes less time to try it then to write the
question, doesn't it!?
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.")
|
|
|
Re: SYLK [message #56646 is a reply to message #56594] |
Thu, 08 November 2007 08:39  |
Jeff[2]
Messages: 18 Registered: November 2007
|
Junior Member |
|
|
On 5 nov, 15:30, Rick Towler <rick.tow...@nomail.noaa.gov> wrote:
> I seem to remember that you can't write mixed types using write_sylk.
> What you can do is modify the write_sylk function such that it does what
> you need. It's pretty simple.
>
> For example, A long time ago I had someone who really wanted to create
> sylk files and also wanted to insert column headers. make_sylk was
> born. You pass a structure:
>
> dat={header:['x','y','z'], data:[1,2,3]}
>
> And the structure is written to file from left to right. Tag names are
> irrelevant. The contents of the first tag will be completely written,
> then the contents of the second, and so on.
>
> This may not be exactly what you are looking for but the point is that
> the modifications are pretty simple. You'll of course need to pass the
> data in as a struct, then figure our how you'll have to pick out the
> data you need in the order you need it. write_sylk is in your idl "lib"
> directory. Make a copy of it and have at it.
>
> My version of make_sylk can be found here:
>
> http://www.acoustics.washington.edu/~towler/programs/make_sy lk.pro
>
> -Rick
>
>
>
> Jeff wrote:
>> Hi there...
>
>> I'd like to know if I can use WRITE_SILK to save float and string data
>> together.
>> Suppose I have tw arrays:
>
>> a=[1.2, 2.3, 4.5, 2.1]
>> b=['a', 'b', 'c', 'd']
>
>> Is it possible to join these arrays in one file using WRITE_SILK??
>
>> Thanks!
>> Julio- Ocultar texto entre aspas -
>
> - Mostrar texto entre aspas -
Thanks Rick!
I changed your make_sylk version to write my data according to my
needs. It worked fine.
I think ITT should make a new version of WRITE_SYLK to allow using
header columns.
Best!
|
|
|