Demo entry 6640681

jqTest1

   

Submitted by anonymous on Sep 12, 2017 at 18:32
Language: C#. Code size: 737 Bytes.

string allpath = @"C:\jq\coordinate\fusion\all.txt";  
  
string[] alllines = File.ReadAllLines(allpath);  
  
  
string halfpath1 = @"C:\jq\coordinate\fusion\halfcutxGreater0.txt";  
  
FileStream fs = new FileStream(halfpath1, FileMode.Append, FileAccess.Write);  
  
StreamWriter sw = new StreamWriter(fs);  
  
  
int length = alllines.Length;  
  
for(int i=0;i<length;i++)  
{  
  
    string curStr = alllines[i];  
    int spaceIndex = curStr.IndexOf(" ");  
  
    string xStr = curStr.Substring(0, spaceIndex);  
  
    double x = Convert.ToDouble(xStr);  
    if(x>0)  
    {  
  
        sw.WriteLine(curStr);  
    }  
  
  
}  
  
sw.Close();  
fs.Close();  
  
MessageBox.Show("done");  

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).