美文网首页
perl脚本删除代码抬头

perl脚本删除代码抬头

作者: 国宝级初学者 | 来源:发表于2021-12-29 11:49 被阅读0次

"""
print "\n\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
print " ----------------- delect comany header --------------- \n";
print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";

inputFileName =ARGV[0];

$indFlag = 0;

$CAFlag = 0;

$harqAllocFlag = 0;

chomp (inputFileName);outputFileName = inputFileName;outputFileName =~ s/.dec//;
outputFileName1 = join(outputFileName,"ecaojua_",".c");
print "output file is $outputFileName1\n";

open(inFile, "< inputFileName") or die "Couldn't open input fileinputFile !\n";
open(outFile1, "> outputFileName1") or die "Couldn't open output fileoutputFile1 !\n";

while(<inFile>)
{
Line =_;
if (Line =~ /.* Description .*/) {indFlag = 1;
next;
}
if (Line =~ /.* Copyright comany AB .*/) {indFlag = 1;
next;
}
if (Line =~ /.* The copyright to the computer .*/) {indFlag = 1;
next;
}
if (Line =~ /.* The programs may be used .*/) {indFlag = 1;
next;
}
if (Line =~ /.* comany AB or in accordance .*/) {indFlag = 1;
next;
}
if (Line =~ /.* agreement/contract under .*/) {indFlag = 1;
next;
}
else
{
print outFile1 "$Line";
}

"""

"""
=pod
if (indFlag == 1) { if (Line =~ /.* cellId (\d+)./)
{
cellId =1;
print outFile1 "cellId,"; next; } if (Line =~ /.
sfn (\d+)./)
{
sfn =1;
print outFile1 "sfn,"; next; } if (Line =~ /.
subFrameNo (\d+)./)
{
subFrameNo =1;
print outFile1 "subFrameNo,"; next; } if (Line =~ /.
dlSubframeNr (\d+)./)
{
dlSubframeNr =1;
print outFile1 "dlSubframeNr,"; next; } if (Line =~ /.
noOfHarqAllocations (\d+)./)
{
noOfHarqAllocations =1;
if (noOfHarqAllocations > 0) {harqAllocFlag = 1;
print outFile1 "noOfHarqAllocations,"; } if (noOfHarqAllocations == 0)
{
print outFile1 "noOfHarqAllocations\n"; }indFlag = 0;
next;
}
}
if (harqAllocFlag == 1) { if (Line =~ /.
bbUeRef (\d+)./)
{
bbUeRef =1;
print outFile1 "bbUeRef,"; next; } if (Line =~ /.
crnti (\d+)./)
{
crnti =1;
print outFile1 "crnti,"; next; } if (Line =~ /.
rxPucchSector (\d+)./)
{
rxPucchSector =1;
print outFile1 "rxPucchSector,"; next; } if (Line =~ /.
freqOffEstPusch (\d+)./)
{
freqOffEstPusch =1;
print outFile1 "freqOffEstPusch,"; next; } if (Line =~ /.
nBundled (\d+)./)
{
nBundled =1;
print outFile1 "nBundled,"; next; } if (Line =~ /.
dlMaxNrOfBundledSubframes (\d+)./)
{
dlMaxNrOfBundledSubframes =1;
print outFile1 "dlMaxNrOfBundledSubframes,"; next; } if (Line =~ /.
bundlingSubframeIndex (\d+)./)
{
bundlingSubframeIndex =1;
print outFile1 "bundlingSubframeIndex,"; next; } if (Line =~ /.
firstCsPucchResource (\d+)./)
{
firstCsPucchResource =1;
print outFile1 "firstCsPucchResource,"; next; } if (Line =~ /.
valid (\d+)./)
{
valid =1;
print outFile1 "valid,"; next; } if (Line =~ /.
dlHarqProcessId (\d+)./)
{
dlHarqProcessId =1;
print outFile1 "dlHarqProcessId,"; next; } if (Line =~ /.
nrOfTb (\d+)./)
{
nrOfTb =1;
print outFile1 "nrOfTb,"; next; } if (Line =~ /.
maxNrOfTbs (\d+)./)
{
maxNrOfTbs =1;
print outFile1 "maxNrOfTbs,"; next; } if (Line =~ /.
isPCell (\d+).*/)
{
isPCell =1;
print outFile1 "isPCell,";harqAllocFlag = 0;
CAFlag = 1; next; } } if (CAFlag == 1)
{
if (Line =~ /.* firstCsPucchResource (\d+).*/) {firstCsPucchResource1 = 1; print outFile1 "firstCsPucchResource1,";
next;
}
if (Line =~ /.* valid (\d+).*/) {valid1 = 1; print outFile1 "valid1,";
next;
}
if (Line =~ /.* dlHarqProcessId (\d+).*/) {dlHarqProcessId1 = 1; print outFile1 "dlHarqProcessId1,";
next;
}
if (Line =~ /.* nrOfTb (\d+).*/) {nrOfTb1 = 1; print outFile1 "nrOfTb1,";
next;
}
if (Line =~ /.* maxNrOfTbs (\d+).*/) {maxNrOfTbs1 = 1; print outFile1 "maxNrOfTbs1,";
next;
}
if (Line =~ /.* isPCell (\d+).*/) {isPCell1 = 1; print outFile1 "isPCell1\n";
$CAFlag = 0;
next;
}
}
=cut
}

close(outFile1);
close(inFile);

'''
"""

相关文章

网友评论

      本文标题:perl脚本删除代码抬头

      本文链接:https://www.haomeiwen.com/subject/bxevqrtx.html