I have a file which I have to read chunk by chunk (based on time stamps). So i am using awk to read between two time intervals, and then I have to process the data further. For that I have to read the string I receive from awk Line By Line. When I perform Split using the new character, it doesn't split, but just all of the string remains in 1st field. I have used different escape characters but without any succes.
My main aim is to read the string line by line.
$cmd = "awk '\$0>=from&&\$0<=to' from=\"$currentTime\" to=\"$nextTime\" Output.txt";
$dataChunk = system ($cmd);
my @lines = split /[\r\s\v\V\n]+/, $dataChunk;
foreach my $line (@lines) {
chomp;
$timeStamp1 = (split /-/, $line)[1];
print "\n$timeStamp1\n";
exit;
}