CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 31

Thread: ABOUT STRING READING FROM textfile

  1. #16
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: ABOUT STRING READING FROM textfile

    so, seems as if you're looking for a way to read the file as a bounch of records and that those records might have different length. Moreover you cannot change the file itself to make sure it can respect a true standard as per start and end of records.
    Not an easy job, but regExp can help in parsing it.
    I am not reading it each time , I read it all at once to load the listBox, and in listBox I put objects that hold all infos. It might be done better (could be faster, smarter,...) but have a look at how I loaded listbox and then how richtextbox is populated on (single) click
    Attached Files Attached Files
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  2. #17
    Join Date
    Feb 2010
    Posts
    11

    Re: ABOUT STRING READING FROM textfile

    Thanks for your reply, but the project you are attaching in VB.NET, What i need is in VB6. I know how to translate any .net language conversion such as VC++ .NET , VB.NET , no problem. What i need is in VB6 as i don't know nothing about it.


    Thanks

  3. #18
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Arrow Re: ABOUT STRING READING FROM textfile

    then let me send your post back to vb 6.0 forum
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  4. #19
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: ABOUT STRING READING FROM textfile

    if what you need is a different way to read from a file in vb 6.0, you might find something of interesting here:

    http://www.codeguru.com/forum/showth...highlight=file
    (look also last answers)

    and here:
    http://www.codeguru.com/forum/showth...5994#post65994
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  5. #20
    Join Date
    Apr 2009
    Posts
    394

    Re: ABOUT STRING READING FROM textfile

    Have you tried the code in post #2???

  6. #21
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: ABOUT STRING READING FROM textfile

    Would you please also NOT post rar-archives, because some of us have problems with some rar formats, as it seems.
    Please post .zip files which everybody is able to open.

    Then let me put a question: what was wrong with the sample I gave?
    It should read all alarm blocks, no matter how many empty lines it encounters between blocks.

  7. #22
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,348

    Re: ABOUT STRING READING FROM textfile

    Quote Originally Posted by davidkhan View Post
    Many thanks for you reply, i was trying to compile your code and when button click i got

    "compiler error: variable not defined " , highlight to this code "ReDim Preserve MyArray(List1.ListCount) As String"


    Do you know what it could be problem?


    Thanks
    Most likely you did not define the variable. The code given is not a complete program but rather a couple of routines. You need to define any variables that will be used.

  8. #23
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: ABOUT STRING READING FROM textfile

    Quote Originally Posted by WoF View Post
    some of us have problems with some rar formats, as it seems.
    try 7-zip. it is free and opens rar...
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  9. #24
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: ABOUT STRING READING FROM textfile

    I paid a few $ to upgrade to WinZip 12.0

    It's great, opens CAB files, and RAR, and ARJ, etc
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  10. #25
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,348

    Re: ABOUT STRING READING FROM textfile

    Winrar opens pretty much everything as well. Lots of files on the internet are in Rar format. Everyone should have something to open them. In general RAR has a tigher compression resultign in smaller files and can handle larger files than Zip but the win rar program supports about everything you would ever need to do.

    7Z, ACE, ARJ, BZ2, CAB, GZ, ISO, JAR, LZH, TAR, UUE, Z
    Last edited by DataMiser; February 27th, 2010 at 02:24 PM.

  11. #26
    Join Date
    Feb 2010
    Posts
    11

    Re: ABOUT STRING READING FROM textfile

    Hello, sorry about the RAR file, i will post it in ZIP file again, but just for advice i have been using WINRAR for 5 years , whenever i need it i download straight from their web,no serial need , no crack but it can do most of the function without even popup reminder to register.
    Regarding about the gentleman "WoF" , i when i testing ,there is nothing load to the textbox , but anyway rather than just explaining i will attach my sample binary in VB.net and sample data again in ZIP.
    If you want to test big file size like 30MB or something please download from http://gb.archive.ubuntu.com/ubuntu/...6/Packages.bz2 or some other package you want

    Thanks
    Attached Files Attached Files

  12. #27
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: ABOUT STRING READING FROM textfile

    ***? Do you think we're crazy? We don't run any .exe's around here.

    I did download and open your CSV file. From the contents, I can probably guess what you're about to attempt, and we'll stop it right now.

    EDIT: Upgraded to WinZip 14.0 for FREE! Glad I bought the upgrade for 1 year. ZIPX is probably the best, but nobody can open them
    Attached Images Attached Images  
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  13. #28
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: ABOUT STRING READING FROM textfile

    Quote Originally Posted by dglienna View Post
    ***? Do you think we're crazy? We don't run any .exe's around here.
    at least, not if we cannot first get the sources from it...Ever tried Lutz Roeder Reflector?
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  14. #29
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: ABOUT STRING READING FROM textfile

    Maybe it downloads every 14th link after some phrase? No thanks...
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  15. #30
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: ABOUT STRING READING FROM textfile

    I got a look at sources of first exe he attached (not at this last one), and the download was manual (but did not worked on my system). No automathic download was there. He simply parsed the cvs file to show a list of package you could find at ubuntu site, and to give you infos on the package you selected. Nothing of harmful in that. The only strange thing is the request to translate code in Vb 6.0, which seems a step back, plus the request to access a sequential file like it were an indexed one by a developer who stated he could deal with Vb.Net, C#, Visual C, but know nothing of Vb6.0...and of ascii files.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)