Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Highlighted
cemokam
Occasional Contributor

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";

 

 

 

 

 

1 REPLY
cemokam
Occasional Contributor

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";