0

Hi there, I'm currently writing code for a translator. The task is to open a file from anywhere on my network, then display it and then allow to save the file. So far I have a window that allows a user to browse for a file, open the file and save it, however, the file needs to be in a certain format, eg, not the form it is saved on the drive as.
Example : One line from the file is
R0001: C0001 + C0002 <=> C0003
these are reactions, products and reactants, the program is required to re-organise these into a different layout:
R0001(C0001 + C0002, C0003)
owever I'm slightly stuck on how to do this. Any help would be brilliant.
Thanks in advance

3
Contributors
2
Replies
3
Views
13 Years
Discussion Span
Last Post by Iron_Cross
0

Hi there, I'm currently writing code for a translator. The task is to open a file from anywhere on my network, then display it and then allow to save the file. So far I have a window that allows a user to browse for a file, open the file and save it, however, the file needs to be in a certain format, eg, not the form it is saved on the drive as.
Example : One line from the file is
R0001: C0001 + C0002 <=> C0003
these are reactions, products and reactants, the program is required to re-organise these into a different layout:
R0001(C0001 + C0002, C0003)
owever I'm slightly stuck on how to do this. Any help would be brilliant.
Thanks in advance

think of creative ways to count ;), spaces, letters etc. For example if you know u will need to format right after the colon start from there, or in your first format place special sentinals.

0

It seems to me, you could use spaces as a tokenizer deliminator. Then just use substring searches to find out if a string containts : or stuff like that, then delete that character. Then it's just a mater of rebuilding the correct format which shouldn't be at all hard.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.