Experts Exchange connects you with the people and services you need so you can get back to work.
string  strVals;
using( StreamReader rdr = new StreamReader( @"c:\a.tsv" ) )
string strTsv, line;
strTsv = string.Empty;
while( (line = rdr.ReadLine()) != null )
strTsv += line + '\t';
strTsv = strTsv.Trim('\t');
strVals = strTsv.Split('\t');
for(int i = 0 ; i < strVals.Length - 1 ; i ++)
for(int j = i + 1 ; j < strVals.Length; j ++)
if(strVals[i].CompareTo(strVals[j]) > 0 )
string tmp = strVals[i];
strVals[i] = strVals[j];
strVals[j] = tmp;
if(strVals.Length > 0 )
using( StreamWriter wtr = new StreamWriter(@"c:\a.tsv", false, System.Text.Encoding.ASCII ) )
foreach(string str in strVals)
wtr.Write(str + "\t");
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.