Sunday 10 August 2014

Write an awk script to delete duplicated line from a text file. The order of the original Lines must remain unchanged.


BEGIN {i=1}
{
flag=1;
for(j=1;j<i && flag ; j++)
{
if(x[j]==$0)
flag=0;
}
if (flag)
{
x[j]=$0;
printf("\n%s",x[i]);
i++;
}
}

1 comments:

Unknown said...
This comment has been removed by the author.

Post a Comment

 
- |