473,407 Members | 2,629 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,407 software developers and data experts.

VB6: Reading from specific line in a txt file

My program keeps a text file list of co-ordinates, for example:

3,5
2,7
12,9
5,6
... and so on, indefinitely.

How do I read the values from the nth line into variables X,Y - say if I specific the 3rd line, then X=12 and Y=9?

Also, how can I search the text file to check if a specific co-ordinate pair is already in the list?
Feb 6 '06 #1
2 10590
Hallo,

dou you mind if you tell me how did you read the specific line number you wanted? thanks,

haydee


My program keeps a text file list of co-ordinates, for example:

3,5
2,7
12,9
5,6
... and so on, indefinitely.

How do I read the values from the nth line into variables X,Y - say if I specific the 3rd line, then X=12 and Y=9?

Also, how can I search the text file to check if a specific co-ordinate pair is already in the list?
Jul 29 '06 #2
sashi
1,754 Expert 1GB
Hi there,

i would suggest you using .ini file instead .txt file.. ini files are more flexible..

you can make use of some simple API.. see below..

Expand|Select|Wrap|Line Numbers
  1. Sub WriteINIStringVirtual(Section, KeyName, Value, FileName)
  2.   WriteINIString Section, KeyName, Value, _
  3.     Server.MapPath(FileName)
  4. End Sub
  5.  
  6. Function GetINIStringVirtual(Section, KeyName, Default, FileName)
  7.   GetINIStringVirtual = GetINIString(Section, KeyName, Default, _
  8.     Server.MapPath(FileName))
  9. End Function 
  10.  
usage..
Expand|Select|Wrap|Line Numbers
  1. WriteINIString "xxx"xxx", "xxx", "filename.ini"
  2.  
Jul 29 '06 #3

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

Similar topics

12
by: David | last post by:
I was hoping to start up a discussion on the pros and cons of VB6 vs VB.NET. Specifically, why should someone switch from VB6 to VB.NET? On the other hand, why should someone not use VB.NET...
40
by: googler | last post by:
I'm trying to read from an input text file and print it out. I can do this by reading each character, but I want to implement it in a more efficient way. So I thought my program should read one...
16
by: Ben Hannon | last post by:
Hi, I'm writting a COM Class in VB.NET to be used in a VB6 project (Tired of the VB6 hassles with cloning and serializing an object). All my classes I need cloneable/serializable are now in a...
2
by: DJ | last post by:
ANY HELP FROM THE MASTERS GREATLY APPRECIATED When reading textfiles with VB.net, some special character text is deleted that does not happen with VB6 (Please see below) ORIGINAL TEXT FILE...
12
by: Yi Xing | last post by:
Hi All, I want to read specific lines of a huge txt file (I know the line #). Each line might have different sizes. Is there a convenient and fast way of doing this in Python? Thanks. Yi Xing
3
by: lizii | last post by:
i have a file - which on each line has some data i need to fill into a box - now although reading in the data is simple enough and putting it in the correct box will be no problem, as i can just...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
5
by: newsaboutgod | last post by:
I think VB.NET drives some people crazy because some simple VB6 things seem so hard. Here is some VB6 code: 'Write CSV File open "c:\test.csv" for output as #1 write#1, "1","2","3","4","5"...
21
by: Stephen.Schoenberger | last post by:
Hello, My C is a bit rusty (.NET programmer normally but need to do this in C) and I need to read in a text file that is setup as a table. The general form of the file is 00000000 USNIST00Z...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.