<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>Hi all,</DIV>
<DIV> </DIV>
<DIV>I have written some data to a file with the following code. I have copied 
the OUTPUT hereunder.</DIV>
<DIV> </DIV>
<DIV>xdisp=open('ansys_xdisp.dat','w')<BR>xdisp.writelines("time")<BR>xdisp.writelines(' 
')<BR>xdisp.writelines("xdisp")<BR>xval_new = 0<BR>time_structure = 
0.005<BR>xdisp.writelines('\n')<BR>xdisp.writelines(str(time_structure))<BR>xdisp.writelines(' 
')<BR>xdisp.writelines(str(xval_new))<BR>xdisp.writelines(' ')</DIV>
<DIV>xdisp.close()</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><STRONG>OUTPUT (in file ansys_xdisp.dat):</STRONG></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>time xdisp<BR>0.005 0<BR></DIV>
<DIV><STRONG>However, I would like to write more efficient code and format the 
output properly so that it looks something like this:</STRONG></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV>time            
xdisp</DIV>
<DIV>0.005            
0</DIV>
<DIV>0.006            0.345</DIV>
<DIV>..</DIV>
<DIV>...</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>Would someone please help me re-write this code properly to do the above 
and also point me to a reference wherein I could find all information about 
Formatting with Files. </DIV>
<DIV> </DIV>
<DIV>I did browse through Python's website to get some info about manipulating 
files. It's not elaborate enough, though. I would need to do more complex 
file-processing tasks shortly. </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thanks in advance</DIV>
<DIV> </DIV>
<DIV>Regards,</DIV>
<DIV>Satish<BR></DIV>
<DIV> </DIV></BODY></HTML>