LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   seek advice on pyqt3 task (https://www.linuxquestions.org/questions/programming-9/seek-advice-on-pyqt3-task-797360/)

gary_in_springhill 03-23-2010 01:37 PM

seek advice on pyqt3 task
 
I have a file that looks like :
PU;
SP3;
PU3320,4049;PD4258,4049;PD4250,3969;PD4236,3892;PD4216,3819;PD4190,3749;PD4157,3684;PD4118,3621;PD40 72,3563;PD4021,3508;PD3965,3458;PD3905,3415;PD3843,3379;PD3777,3349;PD3709,3326;PD3637,3309;PD3562,3 300;PD3484,3296;PD3405,3300;PD3328,3310;PD3255,3328;PD3185,3353;PD3118,3385;PD3054,3425;PD2994,3471; PD2938,3524;PD2886,3583;PD2841,3645;PD2804,3711;PD2773,3780;PD2749,3852;PD2731,3928;PD2721,4007;PD27 18,4090;PD2721,4168;PD2733,4244;PD2752,4318;PD2778,4390;PD2811,4460;PD2852,4525;PD2899,4588;PD2954,4 646;PD3011,4698;PD3072,4743;PD3135,4781;PD3201,4811;PD3271,4835;PD3345,4851;PD3422,4862;PD3503,4865; PD3557,4863;PD3610,4858;PD3661,4850;PD3711,4838;PD3760,4824;PD3807,4805;PD3853,4784;PD3897,4759;PD39 40,4731;PD3980,4700;PD4018,4666;PD4054,4630;PD4088,4590;PD4120,4548;PD4150,4503;PD4177,4455;PD3995,4 455;PD3940,4519;PD3884,4574;PD3826,4619;PD3766,4656;PD3704,4685;PD3638,4705;PD3568,4717;PD3494,4721; PD3431,4718;PD3369,4709;PD3311,4695;PD3254,4675;PD3201,4648;PD3150,4616;PD3101,4579;PD3055,4535;PD30 13,4487;PD2976,4437;PD2945,4385;PD2920,4330;PD2900,4273;PD2886,4214;PD2878,4152;PD2875,4088;PD2878,4 020;PD2886,3955;PD2900,3892;PD2920,3833;PD2945,3777;PD2976,3723;PD3012,3673;PD3054,3625;PD3101,3581; PD3149,3544;PD3201,3512;PD3255,3486;PD3311,3465;PD3370,3451;PD3432,3442;PD3497,3439;PD3548,3441;PD35 98,3447;PD3646,3458;PD3693,3472;PD3739,3491;PD3783,3514;PD3826,3541;PD3868,3572;PD3907,3606;PD3943,3 643;PD3975,3682;PD4004,3724;PD4029,3768;PD4050,3815;PD4068,3864;PD4082,3916;PD3320,3916;PD3320,4049;
PU4590,4687;PD4590,3326;PD4444,3326;PD4444,4835;PD4849,4835;PD4913,4834;PD4970,4830;PD5020,4824;PD50 64,4815;PD5104,4803;PD5142,4788;PD5178,4770;PD5212,4748;PD5254,4714;PD5292,4674;PD5326,4629;PD5354,4 579;PD5377,4525;PD5393,4470;PD5403,4413;PD5406,4355;PD5405,4312;PD5400,4271;PD5392,4231;PD5380,4192; PD5366,4155;PD5348,4120;PD5327,4086;PD5303,4054;PD5276,4024;PD5247,3998;PD5217,3975;PD5185,3956;PD51 52,3940;PD5117,3929;PD5080,3920;PD5042,3916;PD5406,3326;PD5230,3326;PD4783,4054;PD4926,4054;PD4960,4 055;PD4994,4059;PD5025,4066;PD5055,4075;PD5083,4086;PD5110,4101;PD5135,4118;PD5158,4138;PD5179,4159; PD5197,4183;PD5213,4207;PD5226,4234;PD5235,4261;PD5242,4290;PD5247,4321;PD5248,4353;PD5246,4392;PD52 41,4429;PD5233,4465;PD5220,4498;PD5205,4530;PD5187,4559;PD5165,4587;PD5139,4612;PD5116,4631;PD5090,4 647;PD5062,4660;PD5032,4670;PD4995,4677;PD4945,4683;PD4883,4686;PD4808,4687;PD4590,4687;
PU5794,4158;PD6428,4158;PD6428,4009;PD5794,4009;PD5794,3472;PD6428,3472;PD6428,3326;PD5645,3326;PD56 45,4835;PD6428,4835;PD6428,4687;PD5794,4687;PD5794,4158;
PU6859,4158;PD7493,4158;PD7493,4009;PD6859,4009;PD6859,3472;PD7493,3472;PD7493,3326;PD6710,3326;PD67 10,4835;PD7493,4835;PD7493,4687;PD6859,4687;PD6859,4158;
PU8777,3507;PD8759,4835;PD8906,4835;PD8906,3326;PD8728,3326;PD7900,4657;PD7917,3326;PD7771,3326;PD77 71,4835;PD7949,4835;PD8777,3507;
PU;
SP4;
PU8223,7574;PD8223,7441;PD8271,7441;PD8291,7442;PD8308,7445;PD8323,7450;PD8334,7457;PD8343,7466;PD83 50,7478;PD8354,7491;PD8355,7507;PD8354,7523;PD8350,7536;PD8343,7548;PD8334,7557;PD8322,7565;PD8308,7 570;PD8291,7573;PD8271,7574;PD8223,7574;
PU8223,7726;PD8223,7608;PD8243,7608;PD8267,7608;PD8287,7611;PD8303,7615;PD8315,7622;PD8324,7630;PD83 30,7640;PD8334,7653;PD8336,7668;PD8334,7682;PD8331,7694;PD8324,7704;PD8316,7712;PD8304,7718;PD8290,7 723;PD8273,7725;PD8252,7726;PD8223,7726;
PU8189,7760;PD8255,7760;PD8283,7758;PD8307,7754;PD8327,7747;PD8343,7737;PD8355,7724;PD8364,7708;PD83 69,7689;PD8371,7667;PD8370,7655;PD8369,7644;PD8366,7634;PD8361,7625;PD8356,7617;PD8350,7610;PD8342,7 603;PD8333,7597;PD8346,7591;PD8358,7583;PD8368,7574;PD8376,7564;PD8382,7553;PD8387,7540;PD8389,7526; PD8390,7511;PD8388,7486;PD8383,7465;PD8374,7447;PD8361,7433;PD8344,7422;PD8322,7414;PD8297,7409;PD82 67,7407;PD8189,7407;PD8189,7760;
PU8600,7407;PD8442,7407;PD8442,7760;PD8476,7760;PD8476,7442;PD8600,7442;PD8600,7407;
PU8631,7760;PD8666,7760;PD8666,7537;PD8667,7514;PD8668,7498;PD8671,7486;PD8675,7475;PD8680,7466;PD86 87,7458;PD8694,7450;PD8703,7444;PD8712,7439;PD8722,7435;PD8733,7433;PD8744,7433;PD8763,7434;PD8779,7 439;PD8792,7448;PD8803,7460;PD8811,7475;PD8817,7495;PD8821,7518;PD8822,7544;PD8822,7760;PD8856,7760; PD8856,7536;PD8855,7504;PD8849,7476;PD8841,7453;PD8829,7434;PD8814,7419;PD8795,7408;PD8772,7402;PD87 46,7400;PD8732,7400;PD8719,7402;PD8706,7405;PD8695,7408;PD8685,7413;PD8675,7418;PD8667,7425;PD8659,7 433;PD8653,7442;PD8647,7452;PD8642,7463;PD8638,7475;PD8635,7488;PD8633,7503;PD8632,7519;PD8631,7536; PD8631,7760;
PU8952,7602;PD9100,7602;PD9100,7567;PD8952,7567;PD8952,7442;PD9100,7442;PD9100,7407;PD8917,7407;PD89 17,7760;PD9100,7760;PD9100,7725;PD8952,7725;PD8952,7602;
PU;


It may vary from a hundred to 10 thousand lines. What I need to do is alter the values in the xy sets eg:PU8722,3456 I need to add a value to the x and y which I have already calculated via a python script. The header at the front of the xy set has to be preserved (PU or PD).

Should I use a list with 3 components or an array or can it be more simple than that.

After all the addition is done it must be placed in order back into a text file with the "," and ";" in the proper spots as in the original file.

gary_in_springhill 03-23-2010 07:43 PM

have it solved
 
Solved it with built in hpgl commands and a small script...


All times are GMT -5. The time now is 03:02 PM.