Conveting file into binary mode

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2008
Posts: 8
Reputation: man4ish is an unknown quantity at this point 
Solved Threads: 0
man4ish man4ish is offline Offline
Newbie Poster

Conveting file into binary mode

 
0
  #1
Mar 31st, 2009
I have one file with the following tab separated records with four columns.Now I am trying to convert the file into fixed length binary file. How it is possible. in C++.
rs149915 29103059 A/G +
rs149932 29116347 C/G -
rs149933 29123223 C/G -
rs149934 29084753 C/T -
rs150082 29117038 A/C -
rs150083 29123057 A/T -
rs150084 29122512 C/T -
rs150085 29120374 G/T -
rs150086 29128450 C/T -
rs150087 29142365 A/G -
rs150088 29135120 C/T -
rs150089 29131901 A/G -
File should be converted into binary so that it can be used with seekg and seekp pointers in C++ for retrieving records.
Thanks in advance.
Last edited by man4ish; Mar 31st, 2009 at 5:56 am. Reason: wrong title :
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 360
Reputation: jencas is just really nice jencas is just really nice jencas is just really nice jencas is just really nice jencas is just really nice 
Solved Threads: 69
jencas jencas is offline Offline
Posting Whiz

Re: Conveting file into binary mode

 
0
  #2
Mar 31st, 2009
I don't see any problem here. This file already has fixed size records!! Additionally each line is delimited by a CR/LF pair. So the record size evaluates to 25 (if I counted correctly)
If you are forced to reinvent the wheel at least try to invent a better one!

Please use code tags - Please mark solved threads as solved
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 39
Reputation: Danny_501 is an unknown quantity at this point 
Solved Threads: 1
Danny_501's Avatar
Danny_501 Danny_501 is offline Offline
Light Poster

Re: Conveting file into binary mode

 
0
  #3
Mar 31st, 2009
I don't think you can convert the actual file into a binary file, but you can input the data then output it into another binary file.

are you able to input the data and store them into a record?
Can you post some code of what you have already done so we know what your struggling with?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC