|
-
Sep 19th, 2013, 03:29 AM
#1
Thread Starter
New Member
-
Sep 19th, 2013, 03:56 AM
#2
Re: ORDER A"file.txt" IN ALPHABETICAL ORDER
My ears, my ears, my ears. Luckily I am 50% deaf in one ear....
Anyways, this can be helpful :
http://msdn.microsoft.com/en-us/libr...=vs.80%29.aspx
As I would suggest you read your file differently and not with FileOpen.
VB.NET MVP 2008 - Present
-
Sep 19th, 2013, 07:27 AM
#3
Thread Starter
New Member
Re: ORDER A"file.txt" IN ALPHABETICAL ORDER
thanks for your reply but unfortunately does not meet my request for help. If possible I would like that you wrote to me a piece of code that makes me sort my files in alphabetical order thanks
-
Sep 19th, 2013, 07:36 AM
#4
Re: ORDER A"file.txt" IN ALPHABETICAL ORDER
Problem is: I'm not here to write code, I'm here to help you fish. That is how I know what I know. Hopefully someone else will write your code for you....
VB.NET MVP 2008 - Present
-
Sep 19th, 2013, 07:42 AM
#5
Thread Starter
New Member
Re: ORDER A"file.txt" IN ALPHABETICAL ORDER
ok then could you explain how to order a txt file in alphabetical order?
-
Sep 19th, 2013, 08:00 AM
#6
Re: ORDER A"file.txt" IN ALPHABETICAL ORDER
read it into an array and sort the array.OrderBy
Look at this link.
This gives different ways to do it (with code) and also shows how to order by a particular field in the structure.
-
Sep 19th, 2013, 11:31 AM
#7
Addicted Member
Re: ORDER A"file.txt" IN ALPHABETICAL ORDER
Where is the data coming from and where is it going? If it's coming from a database, order the data before the export.
-
Sep 20th, 2013, 02:04 AM
#8
Thread Starter
New Member
Re: ORDER A"file.txt" IN ALPHABETICAL ORDER
no data are loaded directly from a file.txt still are not able to communicate with the access database VB2005
-
Sep 20th, 2013, 09:25 AM
#9
Re: ORDER A"file.txt" IN ALPHABETICAL ORDER
Code:
Imports System.IO
...
Dim ReadLines() as Cliente = File.ReadAllLines(PathToFileOnDisk) 'PathToFileOnDisk is a string with the absolute path name to the .txt file
ReadLines= ReadLines.OrderBy(Function(c) c.NOME)
File.WriteAllLines (PathToFileOnDisk, ReadLines)
This is free typed and NOT TESTED but it should do what you are wanting. It will order the records by the field "NOME" in the structure.
This is not to be copied and pasted but is a guide to what you need to do.
-
Sep 20th, 2013, 06:44 PM
#10
Addicted Member
Re: ORDER A"file.txt" IN ALPHABETICAL ORDER
 Originally Posted by Gaspare
no data are loaded directly from a file.txt still are not able to communicate with the access database VB2005
I mean't before it becomes the text file where is the data coming from? Does it come from a program's output? exported for a database?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|