Storing data in a file with seperators
-
Hi, I have a program that needs to saves a lot of different data into a file. What I did was to put a seperator inbetween data and I used the character ^E (ASCII code 5) as the seperator. I later found out that it is fine if the data is all in English alphabets. However, other non-English languages actually uses ASCII code 5 as a readable/writable character. So if the data itself happens to have code 5 in it, my program mistakens it as a seperator and everything goes wrong. So what I would like to know is what are the better ways organize data in a file (besides using a character as a sepeartor). And if I had to use the separator scheme, what are the best ASCII characters to use as separators? I also don't want to use MFC's CFile and CArchive to write data. Thank you very much!
-
Hi, I have a program that needs to saves a lot of different data into a file. What I did was to put a seperator inbetween data and I used the character ^E (ASCII code 5) as the seperator. I later found out that it is fine if the data is all in English alphabets. However, other non-English languages actually uses ASCII code 5 as a readable/writable character. So if the data itself happens to have code 5 in it, my program mistakens it as a seperator and everything goes wrong. So what I would like to know is what are the better ways organize data in a file (besides using a character as a sepeartor). And if I had to use the separator scheme, what are the best ASCII characters to use as separators? I also don't want to use MFC's CFile and CArchive to write data. Thank you very much!
Tab and comma are the most common separators. Ascii characters below 0x20 are control characters, so I have trouble imagining a language which uses Ascii 5 as a character. What language is this? Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program
-
Hi, I have a program that needs to saves a lot of different data into a file. What I did was to put a seperator inbetween data and I used the character ^E (ASCII code 5) as the seperator. I later found out that it is fine if the data is all in English alphabets. However, other non-English languages actually uses ASCII code 5 as a readable/writable character. So if the data itself happens to have code 5 in it, my program mistakens it as a seperator and everything goes wrong. So what I would like to know is what are the better ways organize data in a file (besides using a character as a sepeartor). And if I had to use the separator scheme, what are the best ASCII characters to use as separators? I also don't want to use MFC's CFile and CArchive to write data. Thank you very much!
Use fixed length data if you can, then you don't need any separator. Or use the same delimiters as Excel(or Access) uses. Test by selecting save as,Save as type, and select some standard type. jhaga CodeProject House, Paul Watson wrote: ...and the roar of John Simmons own personal Nascar in the garage. Meg flitting about taking photos.Chris having an heated arguement with Colin Davies and .S.Rod. over egian values. Nish manically typing *censur*. Duncan racing around after his pet *c.* Michael Martin and Bryce loudly yelling *c.* C.G. having a fit as Roger Wright loads up *c.* . Anna waving her *c.* and Deb scoffing chocolates in the corner. ...Good heavens!
-
Hi, I have a program that needs to saves a lot of different data into a file. What I did was to put a seperator inbetween data and I used the character ^E (ASCII code 5) as the seperator. I later found out that it is fine if the data is all in English alphabets. However, other non-English languages actually uses ASCII code 5 as a readable/writable character. So if the data itself happens to have code 5 in it, my program mistakens it as a seperator and everything goes wrong. So what I would like to know is what are the better ways organize data in a file (besides using a character as a sepeartor). And if I had to use the separator scheme, what are the best ASCII characters to use as separators? I also don't want to use MFC's CFile and CArchive to write data. Thank you very much!
Use XML and you'll be fine.
-
Use XML and you'll be fine.