| | |
Simpel string sorting
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Dec 2008
Posts: 2
Reputation:
Solved Threads: 0
Hi All,
After reading a long time on Daniweb, it's my time to ask you guys something.
I am combining textfiles with a foreach loop. At this point it's working correctly with the following code:
Is there a simple way to sort the final string (before saving) on a particular position in the line? All lines have the same character count, and I want to save the file sorted on position 138 (7 characters).
Thanks in advance,
Schokbreker
After reading a long time on Daniweb, it's my time to ask you guys something.
I am combining textfiles with a foreach loop. At this point it's working correctly with the following code:
C# Syntax (Toggle Plain Text)
foreach (string readfile in openFileDialog1.FileNames) { string completepath = Path.GetFullPath(readfile); StreamReader sr = new StreamReader(completepath, Encoding.Default, true, 1024); StringBuilder filetosave = new StringBuilder(); string text = sr.ReadToEnd(); filetosave.Append(text); string finalfile = filetosave.ToString(); File.AppendAllText(saveto + "\\combined.txt", finalfile.ToUpper(), Encoding.Default); sr.Close(); sr.Dispose(); }
Is there a simple way to sort the final string (before saving) on a particular position in the line? All lines have the same character count, and I want to save the file sorted on position 138 (7 characters).
Thanks in advance,
Schokbreker
![]() |
Other Threads in the C# Forum
- Previous Thread: Run ppt with C#- urgent !!!!
- Next Thread: openin more forms C#
| Thread Tools | Search this Thread |
.net access algorithm array asp.net bitmap box broadcast c# check checkbox client combobox communication control conversion csharp database datagrid datagridview dataset datetime dbconnection decryption degrees design developer draganddrop drawing encryption enum eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net hospitalmanagementsystem image input install interface java libraries list loop marshalbyrefobject math mouseclick movingimage mysql netcfsvcutil.exe numeric operator path photoshop php picturebox pixelinversion platform polynomial post programming properties radians read regex remoting richtextbox server sleep socket sql statistics string stringformatting study sun system.servicemodel table tcpclientchannel text textbox thread time timer update usb usercontrol validation visualstudio webbrowser winforms wpf wpfc# xml






