asked on
ASKER
P_HWD P BP NMISS BETA SE
4026 38/492/1483 0.7826 0.03842 125456933 1993
2589 135/770/1068 0.8619 0.6415 21227772 1952
4016 1/105/1902 1 0.7665 1347325 1987
1234 424/1024/568 0.3705 0.2921 185118462 1995
For example order by column 5.
I want to order the values from small to largeBy text length, or actual (converted) value?
ASKER
string[] lines;
string heading;
using (System.IO.StreamReader reader = new System.IO.StreamReader("input.txt"))
{
heading = reader.ReadLine();
var sorted = from line in reader.ReadToEnd().Split('\n')
let columns = line.Split('\t')
orderby Convert.ToDouble(columns[4])
select line;
lines = sorted.ToArray();
}
using (System.IO.StreamWriter writer = new System.IO.StreamWriter("output.txt"))
{
writer.WriteLine(heading);
writer.Write(string.Join("\n", lines));
}
ASKER
using (System.IO.StreamReader reader = new System.IO.StreamReader("input.txt"))
{
heading = reader.ReadLine();
var sorted = from line in reader.ReadToEnd().Split('\n')
let columns = line.Split('\t')
where(column[3]>1000.00 && column[3]<=5000.00)
orderby Convert.ToDouble(columns[4])
select line;
lines = sorted.ToArray();
}
ASKER
C# is an object-oriented programming language created in conjunction with Microsoft’s .NET framework. Compilation is usually done into the Microsoft Intermediate Language (MSIL), which is then JIT-compiled to native code (and cached) during execution in the Common Language Runtime (CLR).
TRUSTED BY
ASKER
The first line is a header which is not numeric.