file format

hai friends,
can any one help me, how a file can be written in this format? (its not tab space, comma's in same alignment etc....)

thanks in advance
ebe


291, -155.2618674362, -312.4699975118, -158.3235269719
292, -152.7159348032, -294.7700670966, -169.9035538596
293, -149.8688381587, -302.8424745854, -167.37701072
294, -151.3420117452, -306.3394332771, -164.8944909959
295, -155.204021986 , -290.4783345935, -170.672678834
296, -204.4775226763, -312.3697180108, -133.7351661413
297, -152.8023827466, -309.8060879312, -162.3658273562
298, -200.6985650952, -318.681266784 , -132.1288652542
299, -190.124238568 , -330.2859627667, -130.3938161562
300, -196.9487551194, -324.7918210306, -130.1605650714
301, -153.7362481268, -305.9901483286, -156.5789518607
302, -193.4295296017, -328.6365617318, -129.5545565345
303, -190.2840919609, -315.2338960707, -126.0248053304
304, -186.8055257458, -330.2562205108, -132.4781744133
305, -186.8681177528, -313.6858855833, -129.2504964253
306, -183.4477276769, -328.5200085983, -135.790117089
307, -183.4242731118, -312.1279002185, -132.4057429232
308, -180.0368018444, -326.7124363553, -139.0197701842
309, -179.9406109878, -310.5576975161, -135.5153563239
310, -176.5844169024, -324.8417261586, -142.1693068827
311, -176.423555083 , -308.9784448495, -138.5838695132
312, -173.1001247554, -322.9169356787, -145.2438630628
313, -172.8786255517, -307.3930548722, -141.6162745464
314, -169.5880497115, -320.9422995373, -148.24981941
315, -166.0493747788, -318.920115249 , -151.1935007219
316, -162.4882457554, -316.8535329907, -154.0790021444
317, -158.9105599237, -314.7478750002, -156.9117026232
318, -155.324315876 , -312.6083097702, -159.7023480288
319, -156.8276597266, -291.7482834532, -175.0557898888
320, -155.229598245 , -290.6451009877, -174.321379501
321, -156.6484298366, -299.0268954362, -170.9958283374
322, -154.1144889698, -296.3601942437, -173.4325315894
1
2
3
4
5
6
7
8
enum { PRECISION= 10, FWIDTH = 15 } ;
file << std::fixed << std::setprecision(PRECISION) ;
int i = 291 ;
double d = -155.2618674362, e = +312.4699, f = -158.3235269 ;
file << std::noshowpos << std::setw(3) << i << ','
     << std::showpos << std::setw(FWIDTH) << d << ','
     << std::setw(FWIDTH) << e << ','
     << std::setw(FWIDTH) << f << '\n' ;

Topic archived. No new replies allowed.