I have a file that looks like this:
%chk=M24009.chk
# mp2/cc-pVTZ
M24009
0 1
C 0.000000000 1.389600000 0.000000000
C 0.000000000 -1.389600000 0.000000000
C 1.207900000 0.694800000 0.000000000
C -1.207900000 0.694800000 0.000000000
C -1.207900000 -0.694800000 0.000000000
C 1.207900000 -0.694800000 0.000000000
C 0.000000000 -4.587500000 4.200000000
C 0.000000000 -7.412500000 4.200000000
C 1.207900000 -5.293800000 4.200000000
C -1.207900000 -5.293800000 4.200000000
C -1.207900000 -6.706200000 4.200000000
C 1.207900000 -6.706200000 4.200000000
F 0.000000000 2.730000000 0.000000000
F 2.149700000 1.365000000 0.000000000
F -2.149700000 1.365000000 0.000000000
F -2.149700000 -1.365000000 0.000000000
F 2.149700000 -1.365000000 0.000000000
F 0.000000000 -2.730000000 0.000000000
Br 0.000000000 -2.663100000 4.200000000
Br 2.149700000 -4.331600000 4.200000000
Br -2.149700000 -4.331600000 4.200000000
Br -2.149700000 -7.668400000 4.200000000
Br 2.149700000 -7.668400000 4.200000000
Br 0.000000000 -9.336900000 4.200000000
I would like to get rid of the line that begins with #. Given the use of the # in scripting, I am having problems figuring out how to remove lines that start with it.
I am aware that sed can do something similar to this using:
sed '/^P/d' fname.gjf > fname.xyz
which would remove all lines beginning with P.
I just don't know how to call in the # character as the character the line starts with.
Desired output:
%chk=M24009.chk
M24009
0 1
C 0.000000000 1.389600000 0.000000000
C 0.000000000 -1.389600000 0.000000000
C 1.207900000 0.694800000 0.000000000
C -1.207900000 0.694800000 0.000000000
C -1.207900000 -0.694800000 0.000000000
C 1.207900000 -0.694800000 0.000000000
C 0.000000000 -4.587500000 4.200000000
C 0.000000000 -7.412500000 4.200000000
C 1.207900000 -5.293800000 4.200000000
C -1.207900000 -5.293800000 4.200000000
C -1.207900000 -6.706200000 4.200000000
C 1.207900000 -6.706200000 4.200000000
F 0.000000000 2.730000000 0.000000000
F 2.149700000 1.365000000 0.000000000
F -2.149700000 1.365000000 0.000000000
F -2.149700000 -1.365000000 0.000000000
F 2.149700000 -1.365000000 0.000000000
F 0.000000000 -2.730000000 0.000000000
Br 0.000000000 -2.663100000 4.200000000
Br 2.149700000 -4.331600000 4.200000000
Br -2.149700000 -4.331600000 4.200000000
Br -2.149700000 -7.668400000 4.200000000
Br 2.149700000 -7.668400000 4.200000000
Br 0.000000000 -9.336900000 4.200000000