Re: Perl Script Help first day of the given weekn in a year (182 Views)
Reply
Occasional Contributor
cemokam
Posts: 3
Registered: ‎08-19-2011
Message 1 of 2 (185 Views)

Perl Script Help first day of the given weekn in a year

Hello Forum,

 

I have text data  for to manipulation. I get string like "201319" so "19" refers the week of the year 2013.

I wan to get the first day of this week (19).

 

Actually;here is my source.txt;

 

"SA4";"00000000000003";"0160";"001";"36.25402.6480";0000;2;;"Immediate";"Weekly";130519;"0";0;0;0;;;"SA4_END";
"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;0;;"Released";"Weekly";130203;"0";0;30;30;;;"SA4_END";
"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;19;;"Planned";"Weekly";;"0";0;30;30;;;"SA4_END";
"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;20;;"Planned";"Weekly";;"0";0;0;0;;;"SA4_END";
"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;0;;"Planned";"Monthly";130501;"0";0;60;60;;;"SA4_END";
"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;0;;"Planned";"Monthly";130601;"0";0;90;90;;;"SA4_END";
"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;0;;"Planned";"Monthly";130701;"0";0;120;120;;;"SA4_END";
"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;0;;"Planned";"Monthly";130801;"0";0;180;180;;;"SA4_END";
"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;0;;"Planned";"Monthly";130901;"0";0;60;60;;;"SA4_END";
"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;0;;"Planned";"Monthly";131001;"0";0;85;85;;;"SA4_END";
"SA6";"00000000000003";"0160";"001";"36.25402.6480";"09840190091";"";30;;;;;;;;;"SA6_END";

 

 

I have to go to the strings ;

 

"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;19;;"Planned";"Weekly";;"0";0;30;30;;;"SA4_END";
"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;20;;"Planned";"Weekly";;"0";0;0;0;;;"SA4_END";

 

Then get the final date as yymmdd from 19th week of 2013----->130506 (because the 19th week of 2013 is May and

the first day of the week is 06)

 

20th week of 2013----->130513---->(because the 20th week of 2013 is May and the first day date of week is 13th of May

 

Then I have to add these strings as below then save my source.txt

 

"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;19;130506;"Planned";"Weekly";;"0";0;30;30;;;"SA4_END";
"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;20;130513;"Planned";"Weekly";;"0";0;0;0;;;"SA4_END";

 

 

 

 

 

Please use plain text.
Occasional Contributor
cemokam
Posts: 3
Registered: ‎08-19-2011
Message 2 of 2 (182 Views)

Re: Perl Script Help first day of the given weekn in a year

I have to change these records as ;then save my source.txt

 

"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;19;130506;"Planned";"Weekly";;"0";0;30;30;;;"SA4_END";
"SA4";"00000000000003";"0160";"001";"36.25402.6480";2013;20;130513;"Planned";"Weekly";;"0";0;0;0;;;"SA4_END";

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation