clc
clear all;
format long;
Ns=1000;
order=13;
%**********************read the position and flux density************************
fid=fopen('B.dat','r'); %open the original file
fidnew = fopen('b1.dat','w'); %write the new file
while feof(fid)==0
tline = fgetl(fid); %tline?
if ~ischar(tline), break, end
temp=abs(tline);
Nlength=length(tline);
isemptyline=0; %????????????
if Nlength==0
isemptyline=1;
end
allspace=0; %????????????
isspace=0;
for i=1:Nlength
T=temp(i);
if T==32
isspace=isspace+1;
end
if isspace==Nlength
allspace=1;
break
end
end
findalpha=0; %??????????