Dear friends,

could you please show me the way,how to write the code for converting data from input_file to output files (1001.out,1002.out,1003.out) format.(please see an example attached)
I have already doing with this code writing about four week,but unfortunatlly..,becouse i'm just beginner:-(
 
I have a text file (input_file.txt). And output i need are files 1001.out;1002.out;1003.out.
 
Here are steps what programm must do:
 
1.Open input file
 
2.reads lines from canal "10"- to canal "A0" (info from line "10" to line "A0"  must be one file) 
 
3.convert lines(canal numbers "10","20","30" ... on two first position) as is show in output files. For example:
 
10
20
20
20
20
30
30
30
 
4.and save this data to new  file(1001.out). P.S. File names coming from lines "10 1001" ,acctually file names is from 3 position  for characters,in this case is "1001" or "1002" or "1003"..
 
I'm not sure what I'm trying to do here..
 
#!perl -w
$count = 0;

 while (<STDIN>) {
 if  (substr($_,0,2) eq "10")  {           #If left 2
   ++$count;
   $lines = 0;
   open  OUT, ">$count.out";
   print OUT $_;                   }; 

   }
  __EOF__
 
Any help  welcome!
 
Regards,
 
VItali
Estonia,Tallinn
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
____________________________________________________
  IncrediMail - Email has finally evolved - Click Here

Attachment: 1003.out
Description: unknown/unknown

Attachment: 1002.out
Description: unknown/unknown

Attachment: 1001.out
Description: unknown/unknown

10 1001    
EPLTVL10
20
 0AAAAAAAAAAAA
 0AAAAAAAAAAAA
 0AAAAAAAAAAAA
 0AAAAA
30
 0
 0
 0
 0
 0
90_ _
A01     
10 1002    
EPLTVL10
20
 0BBBBBBBBBB
 0BBBBBBBBBB
 0BBBBBBBBBB
 0BBBBBBBBBB
30
 0
 0
 0
 0
 0
90_ _
A02     
10 1003    
EPLTVL10
20
 0CCCCCCCCCCCC
 0CCCCCCCCCCCCC
 0CCCCCCCCCCCC
 0CCCCCCCCCCCC
30
 0
 0
 0
 0
 0
 0
 0
 0
 0
90_ _
A03     
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to