csripriya1
Programmer
Hi All,
I am new to the awk scripting language. I want to split a large file into multiple small files. I am looking for a pattern in the large file and breaking it into smaller files.
This is how my code looks
{
for(i=1;i<=10;i++)
{
file = "xsaa_"
name = ".sdf"
for (j=1;j<=10; j++)
{
print > (file i name)
getline
while($1 !~ /\$\$\$\$/)
{
print > (file i name)
getline
}
}
print > (file i name)
getline
print (file i name " This file has been printed")
}
exit
}
When I change the size of the loop to 100 or 100 I get incomplete output files. I guess this problem should be simple. But I do not where the bug is. Can anyone please help me with this.
Thanks for your time
I am new to the awk scripting language. I want to split a large file into multiple small files. I am looking for a pattern in the large file and breaking it into smaller files.
This is how my code looks
{
for(i=1;i<=10;i++)
{
file = "xsaa_"
name = ".sdf"
for (j=1;j<=10; j++)
{
print > (file i name)
getline
while($1 !~ /\$\$\$\$/)
{
print > (file i name)
getline
}
}
print > (file i name)
getline
print (file i name " This file has been printed")
}
exit
}
When I change the size of the loop to 100 or 100 I get incomplete output files. I guess this problem should be simple. But I do not where the bug is. Can anyone please help me with this.
Thanks for your time