Welcome to iraf.net Tuesday, April 30 2024 @ 06:40 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Re: arithmetic with text files?
   
joshjturner
 09/13/2006 05:53PM (Read 3382 times)  
+----
Newbie

Status: offline


Registered: 09/13/2006
Posts: 1
Hi -Just a quick question that may not be a good one. Is there a way to divide every entry in a text file or a list by a string? In other words, I have a script that gives me a list of numbers that I want to plot, but I have to normalize by a number (that I have written to another text file), so I've been painfully doing it by hand becaue I can't find an easier way using IRAF. imarith only works on images, but I want to do the same thing basically using lists. Thanks!Josh

 
Profile Email
 Quote
fitz
 09/13/2006 05:53PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
See the TCALC task in the TABLES.TOOLS package.If what you have is a file with some numbers and you want to divide each by a constant:[code:1:8ff4ff49cb]
list = "numbers.txt"
while (fscan (list, x) != EOF) {
print ((x / 3.14159))
}
[/code:1:8ff4ff49cb]Cheers,
-Mike

 
Profile Email
 Quote
   
Content generated in: 0.08 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login