473,387 Members | 3,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Merging data from two output files

1
I have an output file, say OUT.TXT generated using VB6 code.

I also have an input data file say IN.TXT stored on my computer and I need to copy data from some of the columns tn the file IN to the corresponding columns in the file OUT. At present the columns in OUT that I need to put the data in have 0's or nulls.

Pleae help.
Aug 7 '06 #1
2 2204
BSOB
77
um.. hint:
look at the different modes that you can open a file for exiting in. its been a long time since i worked with txt files but there was a mode where line by line editing was posible.
if you dont find it that way, you can always load (read) both files into two seperate string arrays. replace the out strings with the in strings of the index that you want to "move" and then write the out array back to the out file.

and for the record, i say its a hint because that makes it sound like i know more then im giving you and therefore makes me look smart.
Aug 9 '06 #2
I have an output file, say OUT.TXT generated using VB6 code.

I also have an input data file say IN.TXT stored on my computer and I need to copy data from some of the columns tn the file IN to the corresponding columns in the file OUT. At present the columns in OUT that I need to put the data in have 0's or nulls.

Pleae help.
You need to read the file IN.TXT in line by line.

For instance,

Dim n as integer, textline(1000) as string 'for a file up to 1000 lines long
n=1
Open "IN.TXT" for input as #1
while not eof(1)
line input #1, textline(n) 'get whole line
n=n+1
wend
close #1

You now have the whole of your IN.TXT in the textline array and you can pick out the columns you require from there.

Hope this helps.
The Peasant
Aug 9 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jon Bosker | last post by:
Help! This is probably easy but I just don't get it. I am trying to relate and merge 2 datasets. My XML file has 2 datasets (1st level nodes) TimeDetail and TimeSummary. The report is supposed to...
3
by: Mike | last post by:
Hi! I also asked this question in C# group with no results: I have 2 datasets loaded with data from two xml files having the same schema. The files contain data from yesterday and today. I'd...
2
by: Nikhil Prashar | last post by:
I'm trying to merge two XML files that have the same structure but not necessarily the same nodes in the same order. I've tried opening the files as datasets and using the DataSet.Merge() function,...
0
by: steve | last post by:
Hi there, I am trying to import data from 2 dbf files into excel using the 'get external data' option which launches ms query. Ultimately I am merging data with a right join statement. I can...
0
by: Mike | last post by:
Hi! I have 2 datasets loaded with data from two xml files having the same schema. The files contain data from yesterday and today. I'd like to merge both datasets in such a way that the resulting...
2
by: daniel.knights | last post by:
Hello, I was wondering if anyone could shed some light on an issue I am having. I have 3 or 4 xml files which i need to merge onto another xml file called build_log.xml, which is produced using...
5
by: ckoniecny | last post by:
I have the following two files: File1: 11 John Doe 33 Jane Doe 55 Steve Smith File2: 22 Joe Doe 44 Willy Widget
5
by: Albert-jan Roskam | last post by:
Hi, I wrote the program below to merge all xls files in a given directory into one multisheet xls file. It uses xlwt and xlrd. The xls files I use for input are generated by Spss. When I open and...
0
by: Albert-jan Roskam | last post by:
Hi John, Thanks! Using a higher xlrd version did the trick! Regarding your other remarks: -yep, input files with multiple sheets don't work yet. I kinda repressed that ;-) Spss outputs only...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...

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.