473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Regarding converting file from one format to another

Hello,
I am a newbie to coding and now learning python programming.

I have a file named nptmdtrj.txt file which has water, glycine molecules along with x,y,z coordinates. I want only the oxygen of water (named as OW)along with its x,y,z coordinates to be written in another file. I am able to do it, but the problem is i am not able to write the frames ie., as in 1st column in sample.dat file...

I am herein attaching the files..
1) nprmdtrj1.txt is the original file
2) sample.txt is the output file i want to get
3) code1.py is the python code i tried..
4) Trial2.txt is the file i got as output after i ran code1.py.

Any suggestions are highly appreciated...

I am unable to upload the rest of the files.. any suggestions..??
Attached Files
File Type: txt sample.txt (6.0 KB, 253 views)
File Type: txt code1.txt (245 Bytes, 236 views)
Jan 31 '18 #1
2 1895
dwblas
626 Expert 512MB
i am not able to write the frames ie., as in 1st column in sample.dat file
You write the entire line, so if it is not written then it is not in that line. Also, there is no "OW" anywhere in the sample.txt file that you posted so you will get an empty output file.
Jan 31 '18 #2
Actually, the OW's are in the nptmdtrj1.txt file and this file i am unable to load/attach since it is giving error...
Feb 1 '18 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Cengiz Ulku | last post by:
Hi all, As a general question: Is it possible to create custom file formats? I do not mean changing the attribute of a known file. For ex: A text file transformed into a .xyz will still be...
3
by: MrCAD | last post by:
well this is my first post in here..and I need some help regarding multilayer tiff file format. Any link/references would really help me to progress my project. thanks alot in advance MrCAD
1
by: Wayne Aprato | last post by:
I have a client who is running several Access 97 databases that I have written for them. They are about to upgrade to Access 2003. Is the default file format of Access 2003 still Access 2000 the...
4
by: (Pete Cresswell) | last post by:
I've got everything in 2000 format right now, but it's now clear that all of the clients will be running 2003. Is there any advantage in converting? -- PeteCresswell
11
by: Gaurav Agarwal | last post by:
Hi All, Am looking for a python script that can convert fileformats to txt format. Am unable to find anything in python. Currently the InfoCon projects looks pretty good to use, but it is return...
17
by: Eric_Dexter | last post by:
def simplecsdtoorc(filename): file = open(filename,"r") alllines = file.read_until("</CsInstruments>") pattern1 = re.compile("</") orcfilename = filename + "orc" for line in alllines: if not...
24
by: TChilton | last post by:
Hello, I am working on an Access database (version 2000) that allows front-end users to enter data into a form. I then created a macro that allows users to send these data to me which appears in my...
2
by: joyjignesh | last post by:
hi i have make a report with mshflexgrid. the report between two date. when i have written query .open"select * from tablename where t_date>=convert(datetime,' " & text1.text &"') and ...
2
by: jims | last post by:
Hi. I was wondering if anybody could piont me to a reference for the .bak file format. I need to upload a huge amount of data from a unix machine into an MS SQLServer database and have tried...
0
by: mailtosantoshkumar | last post by:
Hi to all, I have problem with how to converting a DSS audio file format to wave format in dotnet. I have a Olympus DSS but i cant able to access the exe as well as dll which they in that...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.