Jump to content



Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!

Toggle shoutbox Shoutbox Open the Shoutbox in a popup

@  agyat : (24 May 2013 - 05:15 PM) O Dear, Where Are You? Without Your Words This Sb Is ..
@  agyat : (23 May 2013 - 01:23 AM) Wow! Mr. Sb Back Home.
@  OpaQue : (23 May 2013 - 12:44 AM) Ting
@  OpaQue : (24 April 2013 - 02:44 PM) I guess, Time to run Mycent script.
@  OpaQue : (24 April 2013 - 02:43 PM) wow.. not much spam. except habatt posting lot of links.. :P
@  yordan : (23 April 2013 - 01:04 PM) You're welcome, agyat. Nice to have been helpful. Second lesson: try full words, "you" instead of "EW".
@  agyat : (23 April 2013 - 05:03 AM) @YORDAN: tHANK EW FOR YOUR FIRST LESSON.   :D
@  yordan : (22 April 2013 - 09:43 PM) @agyat : "why don't you help me", or "please help me", or "please teach us"
@  yordan : (22 April 2013 - 09:42 PM) welcome back, velma
@  velma : (22 April 2013 - 07:51 AM) **yawns** Good to be back, wonder what is going on here :)
@  agyat : (22 April 2013 - 03:50 AM) Oh! so, why don't help me learn english..
@  yordan : (21 April 2013 - 08:38 PM) The goal mentioned by shiu : "learning english, learning computer"
@  agyat : (21 April 2013 - 06:31 PM) WHAT GOAL?
@  yordan : (20 April 2013 - 10:39 AM) yes, that's our goal. simultaneouly learning English and teaching/learning computer using.
@  shiyu : (20 April 2013 - 07:30 AM) learning english,learning computer
@  yordan : (19 April 2013 - 01:11 PM) Oh, I see, it's just a trick in order to force people looking at your texte. Somehow smart, maybe.
@  agyat : (19 April 2013 - 02:54 AM) And of course I know it is not SEO friendly.
@  agyat : (19 April 2013 - 02:52 AM) There may be two possible answers for that ....


1) Shout was posted using mobile keypad.

2) To force people read content carefully and/or with more concentration.
@  agyat : (19 April 2013 - 02:49 AM) There may be two possible answers for that ....
@  yordan : (18 April 2013 - 09:35 PM) however, why this mixing of capital letters in the middle of your text?

Replying to Text File Operations VB.NET


Post Options

    • Can't make it out? Click here to generate a new image

  or Cancel


Topic Summary

Posted 10 August 2011 - 06:47 AM

Reading Textfiles in VB.NETText File Operations VB.NET

how to read a textfile in VB.NET ?? I have a problem regarding the reading of textfile to be save it into textbox 1, textbox2, etc.Example (textfile):Line1: 123 1234 123435Line2: ghj hjkl gbhjnOn line 1 the first value is 123, id like to save it on textbox1.? 1234(textbox2), etx..The same it to others.On line 2 the first value is ghj ,id like to save it on textbox3? etc...Hope to help me this issue.

-question by raKibOY


Posted 08 June 2011 - 12:21 AM

I need to know how to read/write to all the files of a text file except the first line which i need to add the value of +1 toText File Operations VB.NETI am currently making a phonebook using visual basic (it has to use a text file to hold the contents of database) and I am currently stuggling on how to add one to the value of the first line. I am also struggling to write the entire contents of the text file to the database except for the first line despite using various strategies.Thank youBelow is the code that I have used and have completely stuffed up...Function saveinfo(ByRef fname, ByRef lname, ByRef mobile, ByRef homephone, ByRef address, ByRef birthday) Dim information As String information = fname & ":" & lname & ":" & mobile & ":" & homephone & ":" & address & ":" & birthday & ":" Dim database, firstline, line, blanc, file As String Dim savetofile As New System.IO.StreamReader(savefolder + "contacts (DON'T DELETE)") database = savetofile.ReadToEnd() firstline = savetofile.ReadLine() blanc = "" Dim number As String number = savetofile.ReadLine() number += 1 line = savetofile.ReadLine file = line While Not line = EOF(1) If line <> firstline Then file = file & vbCrLf & line End If End While savetofile.Close() Dim writetofile As New System.IO.StreamWriter(savefolder + "contacts (DON'T DELETE)") writetofile.WriteLine(file) writetofile.Write(information) writetofile.Close()

Posted 08 December 2010 - 04:34 PM

How to add to the end of existing text file.Text File Operations VB.NET

Do you mean when you create the StreamWriter you want the Append option?  If so here's an example of how to set this up.

 Dim ioFile As New StreamWriter("MyFile.Txt",True)

 The "True" parameter after the name of the text file allows you to add to the end of the file rather than overwriting the info that is already in it.

-reply by bsee123

 


Posted 17 June 2010 - 08:27 AM

When exploring data from vb.Net to excel.One column which is of string type is having the value 093949. In the excel it is showing as 93949.When the data is 034k89. It is printing correctly.How to get the data 093949 as it is.

 


Posted 03 July 2010 - 06:37 AM

Extracting Formatted .txt file [fixed]Text File Operations VB.NET

The following is a cleaned up version of the above, it adds a <vbcr> to each line to preserve formatting, (useful for when reading .Htm and .Asp files).  It also outputs results to a RichTextBox.  The file name is pulled from a OpenFileDialog box and passed to a TextBox which in turn gets parsed by SteamReader.

------------------------------ Enjoy --------------------------------------

Imports SystemImports System.IO

Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk   Dim strm As System.IO.Stream   strm = OpenFileDialog1.OpenFile()   txtFile.Text = OpenFileDialog1.FileName.ToString()   Dim ioOutput As String = ""   If File.Exists(txtFile.Text) Then   Dim ioFile As New StreamReader(txtFile.Text)   Dim ioLine As String = ""   Dim ioLines As String = ""   While Not ioFile.EndOfStream   ioLine = ioFile.ReadLine   ioLines = ioLines & vbCrLf & ioLine   End While   ioOutput = ioLines   ioFile.Close()   End If   RichTextBox1.Text = ioOutput   End Sub

-reply by mgfranz

 


Posted 08 February 2010 - 09:19 PM

Extracting data from text file into seperate CSV fileText File Operations VB.NET

I have a file similar to the below

blah blah blah label="ABC" label.Value="123" label.Value="456" label.Value="789" label="DEF" label="HIJ" label.Value="111" label.Value="222" blah blah blah. (No CrLf, just  along string)

What I want to do is to be able to extract the values of label and label.Value into a excel sheet. So ideally the file above would end up in excel like...                          

label ABC

label.Value 123

label.Value 456

label.Value 789

label DEF

label HIJ

label.Value 111

label.Value 222

where label and label.Value are in column A and the value in qutoes is in column B (minus the actual quotes)

Does anyone have any examples of VBA code that I can use to do this?

-question by Manish Patel

Posted 12 December 2009 - 01:03 PM

vb codeText File Operations VB.NET

Dear sir/madamCan you please assist me with a visual basic code that will enable me to extract data from a text file and display it in a tabular form in a visual basic window.I wont to be displaying names, date and location.It will be of much help to me and a pleasure as well.Thank you in advance

-question by stanford bonongwe


Posted 12 December 2009 - 01:15 PM

vb codeText File Operations VB.NET

 dear/sir

Am stanford bonongwe and am a student who is leaning visual basic programing.

I have a problem in extracting data from a text file and displaying it in a tabuler form on a visual basic window. Can you please assist me with acode and the procedures that I need to do in order to come up with the above mentioned problem.

thank you for you help in advance

yours faithfully 

stanford Bonongwe

-question by stanford bonongwe

 


Posted 12 December 2009 - 01:42 PM

vb codeText File Operations VB.NETDear sir/madamCan you please assist me with a visual basic code that will enable me to extract data from a text file and display it in a tabular form in a visual basic window.I wont to be displaying names, date and location.It will be of much help to me and a pleasure as well.Thank you in advance-
 
question by stanford bonongwe

Posted 12 October 2009 - 06:38 AM

VB 2005Text File Operations VB.NET

Hi,

I'm a student and I want to know how to design a program that reads text files (*.Txt) without using a database, and the program should be able to retrieve files that contain documents...

-reply by Sewe Oyaya

 


Review the complete topic (launches new window)