Here is an approach that handles interspersed comments in addition to "headers"
FilePrint["test.txt"]
#comment
#comment
#comment
1 2 3
#c2
4 5 6
7 8 9
ImportString[
StringReplace[Import["test.txt", "Text"],
StartOfLine ~~ "#" ~~ Shortest[___] ~~ EndOfLine ~~ "\n" -> ""], "Table"]
{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}
of course you can invent whatever convention you want or even a mix, eg..
`StartOfLine ~~ {"#", "!", "%"} ~~ ...`
another variant:
ImportString[StringJoin@Riffle[
Select[StringSplit[Import["test.txt", "Text"], "\n"],
StringTake[#, 1] != "#" &], "\n"], "Table"]
Even handle end-of-line comments:
#comment
1 2 3
#c2
4 5 6 #note 1
7 8 9
ImportString[StringReplace[Import["test.txt", "Text"], {
StartOfLine ~~ "#" ~~ Shortest[___] ~~ EndOfLine ~~ "\n" -> "",
"#" ~~ Shortest[___] ~~ EndOfLine -> ""
}], "Table"]
{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}
Tested on Windows by the way -- this might need some tweaking to handle different line endings on other systems
Import[something][[n+1;;]]
where n is the number of "commented" line you have. $\endgroup$