The code I need to implement in a Windows batch file is like this (it is currently in Perl):
while(<file>)
{
if($_ =~ m/xxxx/)
{
print OUT "xxxx is found";
}
elsif($_ =~ m/yyyy/)
{
next;
}
else
{
($a,$b) = split(/:/,$_);
$array1[$count] = $a;
$array2[$count] = $b;
$count++;
}
}
My questions are:
- Is this level of complexity possible in Windows batch files?
- If so, how can I put an If condition inside a for loop to read a text file?
Thanks for your attention. If you know the answers, or have any ideas/clues on how to reach the answer, please share them.
EDIT: I am working in Windows. I can use only whatever is provided with Windows by default and that means I cant use Unix utilities.