Skip to content

Instantly share code, notes, and snippets.

@buckett
Created November 14, 2017 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buckett/3f5ce549a78736c693caee089eaaf307 to your computer and use it in GitHub Desktop.
Save buckett/3f5ce549a78736c693caee089eaaf307 to your computer and use it in GitHub Desktop.
This removes comments before the package declaration (useful for .java files). This was used because some files has 2 license headers.
# From end for first comment to package declaration
/*\//,/^package/ {
# Remove anything inside a comment
/^\/\*\*/,/*\// {
d
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment