Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
writing ascii-file with separator
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tobias Geldhauser  
View profile  
 More options Nov 8 2005, 4:12 am
Newsgroups: comp.lang.idl-pvwave
From: "Tobias Geldhauser" <tyg...@gmx.de>
Date: 8 Nov 2005 01:12:49 -0800
Local: Tues, Nov 8 2005 4:12 am
Subject: writing ascii-file with separator
Hello,

i want to write a floating array (tab=fltarr(5,1000) ) in a ascii-file.

I tried

openw, 1,'Data.txt', width=500
printf, 1,tab
close, 1

but the Colums aren't seperated - especially when the numbers are
nagative, then it looks like:

...00000-2.11
...99920 3.222

Now, i wanted to insert a separator like "tab" or ",", because i need
to read the file with excel/origin (without the seperator the file
isn't recognized as a ascii-file - even a "space" would do)

Is there a solution for my problem ? (the easier the better :) )

Greetings

Tobias


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andres  
View profile  
 More options Nov 8 2005, 4:53 am
Newsgroups: comp.lang.idl-pvwave
From: "Andres" <panblo...@gmail.com>
Date: 8 Nov 2005 01:53:48 -0800
Local: Tues, Nov 8 2005 4:53 am
Subject: Re: writing ascii-file with separator
  Hi Tobias,

  maybe you can try the forprint.pro procedure. Cheers,


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Albert  
View profile  
 More options Nov 8 2005, 5:33 am
Newsgroups: comp.lang.idl-pvwave
From: "Peter Albert" <peter.alb...@gmx.de>
Date: 8 Nov 2005 02:33:45 -0800
Local: Tues, Nov 8 2005 5:33 am
Subject: Re: writing ascii-file with separator
Hi Tobias,

use the FORMAT keyword with printf, e.g.

printf, 1, tab, format = '(5f12.3)'  

Cheers,

     Peter


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tobias Geldhauser  
View profile  
 More options Nov 8 2005, 5:37 am
Newsgroups: comp.lang.idl-pvwave
From: "Tobias Geldhauser" <tyg...@gmx.de>
Date: 8 Nov 2005 02:37:26 -0800
Local: Tues, Nov 8 2005 5:37 am
Subject: Re: writing ascii-file with separator
Hi Andres,

thanks for the tip, but unfortunately i didn't work so far (still
working on it ).

Isn't there a way via "format" ?

printf, 1, format='?????', tab

greetings,

Tobias


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Timm Weitkamp  
View profile  
 More options Nov 8 2005, 5:50 am
Newsgroups: comp.lang.idl-pvwave
From: "Timm Weitkamp" <weitk...@esrf.fr>
Date: 8 Nov 2005 02:50:04 -0800
Local: Tues, Nov 8 2005 5:50 am
Subject: Re: writing ascii-file with separator
Tobias,

Have a look at this: <http://www.dfanning.com/tips/csv_file.html>.

Cheers,
Timm

Timm Weitkamp, ESRF, Grenoble, France


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Clinch  
View profile  
 More options Nov 8 2005, 6:01 am
Newsgroups: comp.lang.idl-pvwave
From: Peter Clinch <p.j.cli...@dundee.ac.uk>
Date: Tue, 08 Nov 2005 11:01:44 +0000
Local: Tues, Nov 8 2005 6:01 am
Subject: Re: writing ascii-file with separator

Tobias Geldhauser wrote:
> Isn't there a way via "format" ?

> printf, 1, format='?????', tab

format='(5(" ",F+012.3, " "))'

should give you, for example 5 columns of floating point with a
deliberate space either side of the number, a '+' before positive and a
'-' before negative figures, each figure having 12 total digit spaces
and 3 places of decimals with the leading figures padded by zeros.

Look up "format codes" in help for some other tweaks.

HTH, Pete.
--
Peter Clinch                    Medical Physics IT Officer
Tel 44 1382 660111 ext. 33637   Univ. of Dundee, Ninewells Hospital
Fax 44 1382 640177              Dundee DD1 9SY Scotland UK
net p.j.cli...@dundee.ac.uk     http://www.dundee.ac.uk/~pjclinch/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tobias Geldhauser  
View profile  
 More options Nov 8 2005, 7:06 am
Newsgroups: comp.lang.idl-pvwave
From: "Tobias Geldhauser" <tyg...@gmx.de>
Date: 8 Nov 2005 04:06:39 -0800
Local: Tues, Nov 8 2005 7:06 am
Subject: Re: writing ascii-file with separator
Thank you very much - the file looks perfect.

Greets,

Tobias


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »