473,657 Members | 2,587 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Writing to text file

Yunus's Group May 23, 3:36 pm show options

Newsgroups: microsoft.publi c.dotnet.langua ges.vb
From: "Yunus's Group" <yunusasm...@gm ail.com> - Find messages by this
author
Date: 23 May 2005 12:36:14 -0700
Local: Mon,May 23 2005 3:36 pm
Subject: Writing to text file
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Remove | Report Abuse

Hello,
I have a need to write to a TEXT file which has the columns of data
separated by a tab. I want to add another column as the last column in
the file and add values to all the lines of data in the text file for
that column.
For example: Here is the sample data
EMP_ID EMP_NAME
1 a
2 b
NOW I WANT TO ADD ANOTHER COLUMN GENDER:
EMP_ID EMP_NAME GENDER
1 a M
2 b F
Reply

Jerry Camel May 23, 4:31 pm show options

Newsgroups: microsoft.publi c.dotnet.langua ges.vb
From: "Jerry Camel" <rlrc...@msn.co m> - Find messages by this author
Date: Mon, 23 May 2005 16:31:00 -0400
Subject: Re: Writing to text file
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse

Read in the entire line, append your text and write it to a new file.

"Yunus's Group" <yunusasm...@gm ail.com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
- Hide quoted text -
- Show quoted text -
Hello, I have a need to write to a TEXT file which has the columns of data
separated by a tab. I want to add another column as the last column in the file and add values to all the lines of data in the text file for that column.
For example: Here is the sample data
EMP_ID EMP_NAME
1 a
2 b
NOW I WANT TO ADD ANOTHER COLUMN GENDER:
EMP_ID EMP_NAME GENDER
1 a M
2 b F


Reply

Yunus's Group May 23, 5:14 pm show options

Newsgroups: microsoft.publi c.dotnet.langua ges.vb
From: "Yunus's Group" <yunusasm...@gm ail.com> - Find messages by this
author
Date: 23 May 2005 14:14:26 -0700
Local: Mon,May 23 2005 5:14 pm
Subject: Re: Writing to text file
Reply | Reply to Author | Forward | Print | Individual Message | Show
original | Remove | Report Abuse

Thanks for the reply,
Is there a way to write to the same file? instead of creating a new
file?
Reply

Nov 21 '05 #1
0 1710

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
4598
by: Neil Trigger | last post by:
Is there a way of creating a seperate text file on a server every time a form is sent? -- ¿ Trigger ? http://www.magic2k.com/ http://www.oddmap.co.uk
2
3763
by: sp | last post by:
Hello everybody, I have an xml doc and I am trying to write the values from xml file to a tab delimited text file. Currently, what I am doing is I am reading xml file through XpathNavigaotr and manipulating all the nodes,elements and attributes than I am writing those values to a text file using stream writer. Now coming to my problem When I am writing data to the text file value of the last record is getting truncated. My code sample...
2
6853
by: melanieab | last post by:
Hi, I'm trying to store all of my data into one file (there're about 140 things to keep track of). I have no problem reading a specific string from the array file, but I wasn't sure how to replace just one item. I know I can get the entire array, then save the whole thing (with a for loop and if statements so that the changed data will be saved), but it seems like a lot of unnecessary reading and writing. Is there a way to directly save...
3
10328
by: CsharpNewcommer | last post by:
Hi Can someone tell me how to write the data from a TextBox (txt) or Label (lbl) to a text file to be printed. I have read the info from msdn.microsoft.com/library on "Writing Text to a File", and it only offers a solution for writing a text string and the system date. Help!!!!! I'm at a lost! Thanks
2
4483
by: Tony | last post by:
Yes, I need to specify a font type so that the characters will be evenly spaced when I write to a tab delimited text file. So how does one specify a font type to write/print and which font is best for evenness?
3
18958
by: nicolasg | last post by:
Hi, I'm trying to open a file (any file) in binary mode and save it inside a new text file. After that I want to read the source from the text file and save it back to the disk with its original form. The problem is tha the binary source that I extract from the text file seems to be diferent from the source I saved. Here is my code: 1) handle=file('image.gif','rb')
3
3112
by: sethuganesh | last post by:
hi, i am not able to write a text properly in a text file in vb.net.below is the code that i have written. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim counter As Integer FileOpen(1, "c:\sample.txt", OpenMode.Random, , , 50) For Counter = 1 To 5
5
6195
by: grinder | last post by:
first off, i am an extreme newbie to C. i am an undergrad research assistant and i have been shifted to a project that involves building a fairly involved c program. The part that i am stuck on now is as follows: - i am trying to write code that will take any number of text inputs (names of other text files) and put them into a file line-by-line at the users request. meaning, i want the user to be able to type the strings and enter them...
6
5260
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
0
8394
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8306
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7327
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.