C 解析雷射干涉儀 rtl 文字檔案資料

2021-09-28 16:46:44 字數 1184 閱讀 3811

從雷射干涉儀中,標出來的資料,要補償到運動控制卡系統,從而實現位置補償功能,進行um級別精確控制。

知識點:

1,文字檔案讀取;

2,字串 string   擷取、分割等;

需要把綠框內的資料解析出來;

讀取檔案  -----解析

private void btnpars_click(object sender, eventargs e)

string pars = new string[2000];

//按行解析

pars = org.split("\r\n".tochararray(), stringsplitoptions.removeemptyentries);

string targetstring;

int targetnum = 0;

bool bstartget = false;

int count = 0;

listdatelist = new list();

foreach(var f in pars)

if(f.indexof("run target data:") == 0)

//獲取全部補償的資料

if(bstartget && count < targetnum*2)

}richtextboxaferpars.text = "";

listposlist = new list();

//獲取最後資料 正向

poslist = getpositivearray(datelist, targetnum, 1);

///

/// 獲取最後解析資料

///

///

///

/// 0  正向 ;1 反向

///

private listgetpositivearray(listlist,int count,int mode = 0)

}else

}return poslist;

}運動控制,需要返回  long   陣列格式的,再轉化就ok了。

C語言文字檔案解析

把檔案按照行分割成多個檔案 define row max length 80 define fnm max length 12 include include void main char ufilename fnm max length while ch eof ch fgetc fp 讀取單個字...

Python之文字檔案解析

最近的工作主要是元件相容性測試,原有的框架有很多功能還不完善,需要補充!比如,需要將autoit指令碼的執行結果寫入到excel中,最後的解決方案是使用本地的log來解析這個結果!created on may 3,2013 author berlin class autoitresultparser...

C 處理文字檔案

文字檔案是一種常用的檔案格式,所以如何處理文字檔案也就成為程式設計的乙個重點。本文就來 一下用c 是如何來處理文字檔案。其內容重點就是如何讀取文字檔案內容 如何改變文字檔案的內容,以及如何用c 來實現對讀取後的文字檔案的列印預覽和列印。一 本文程式設計和執行的軟體環境 1 微軟公司視窗2000伺服器...