求java io解析和生成急急急!!!最好有全部代码,谢谢。 解析文件如下;
gnss_A=123456!1~9gnss_B=abcd!a~zgnss_C=1a2b3c!1~9,a~z+gnsssatellitegnss_gps=G01!gpssa...
gnss_A = 123456 ! 1~9
gnss_B = abcd ! a~z
gnss_C = 1a2b3c ! 1~9,a~z
+gnss satellite
gnss_gps = G01 ! gps satellite
gnss_gls = R26 ! glonass satellite
-gnss satellite
+glonass satellite
gnss_gps = G12 ! gps satellite
gnss_gls = R25 ! glonass satellite
-glonass satellite
gps_date = 2012 11 13gps_time = 15 11 23
+gnss station
name = ABCD
-gnss station
+low station
name = EFGH
-low station
+Satellite used
*PRN TYP PCV CLK SIGO PD X Y Z
G02 GPS NOA REF 30001 10.1 0.1 1.1 1.1
G03 GPS NOB REF 30002 10.2 0.2 2.1 2.2
G04 GPS NOC REF 30003 10.3 0.3 3.1 3.3
G05 GPS NOD REF 30004 10.4 0.4 4.1 4.4
G06 GPS NOE REF 30005 10.5 0.5 5.1 5.5
R01 GLS NOF LCK 30006 10.6 0.6 6.1 6.6
R02 GLS NOG LCK 30007 10.7 0.7 7.1 7.7
R03 GLS NOH LCK 30008 10.8 0.8 8.1 8.8
R19 GLS NOI LCK 30009 10.9 0.9 9.1 9.9
-Satellite used
+Station used
*NAME FLAG1 FLAG2 CLK DATA1 DATA2
ABCD E F CLK 30001 10.1
EFGH R O CLK 30001 10.1
MNWY C D CLK 30001 10.1
NBVC E M CLK 30001 10.1
OPUI Q C CLK 30001 10.1
-Station used 展开
gnss_B = abcd ! a~z
gnss_C = 1a2b3c ! 1~9,a~z
+gnss satellite
gnss_gps = G01 ! gps satellite
gnss_gls = R26 ! glonass satellite
-gnss satellite
+glonass satellite
gnss_gps = G12 ! gps satellite
gnss_gls = R25 ! glonass satellite
-glonass satellite
gps_date = 2012 11 13gps_time = 15 11 23
+gnss station
name = ABCD
-gnss station
+low station
name = EFGH
-low station
+Satellite used
*PRN TYP PCV CLK SIGO PD X Y Z
G02 GPS NOA REF 30001 10.1 0.1 1.1 1.1
G03 GPS NOB REF 30002 10.2 0.2 2.1 2.2
G04 GPS NOC REF 30003 10.3 0.3 3.1 3.3
G05 GPS NOD REF 30004 10.4 0.4 4.1 4.4
G06 GPS NOE REF 30005 10.5 0.5 5.1 5.5
R01 GLS NOF LCK 30006 10.6 0.6 6.1 6.6
R02 GLS NOG LCK 30007 10.7 0.7 7.1 7.7
R03 GLS NOH LCK 30008 10.8 0.8 8.1 8.8
R19 GLS NOI LCK 30009 10.9 0.9 9.1 9.9
-Satellite used
+Station used
*NAME FLAG1 FLAG2 CLK DATA1 DATA2
ABCD E F CLK 30001 10.1
EFGH R O CLK 30001 10.1
MNWY C D CLK 30001 10.1
NBVC E M CLK 30001 10.1
OPUI Q C CLK 30001 10.1
-Station used 展开
3个回答
展开全部
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("c:/www/test.txt")));
String line = null;
StringBuilder sb = new StringBuilder();
while((line = br.readLine()) != null) {
if (line.startsWith("+") || line.startsWith("-")) {
continue; //+ 或 - 号开头,直接跳过
}
sb.append(line); //这就是你需要的内容
}
// 这就是你需要的内容
String content = sb.toString();
最后,自己记得把流关闭掉 good luck ^_^
String line = null;
StringBuilder sb = new StringBuilder();
while((line = br.readLine()) != null) {
if (line.startsWith("+") || line.startsWith("-")) {
continue; //+ 或 - 号开头,直接跳过
}
sb.append(line); //这就是你需要的内容
}
// 这就是你需要的内容
String content = sb.toString();
最后,自己记得把流关闭掉 good luck ^_^
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询