I'm trying to get something to work here and not having much luck. I can
take the sledgehammer approach (read each line, parse for the tab sepertor,
put each part in it's respective element) but with all the array functions
in 2005 there has to be an easier way.
Suggestion??? (code appreciated, I'm learning).
//al 2 1127
"al jones" <al**********@shotmail.com> schrieb: I'm trying to get something to work here and not having much luck. I can take the sledgehammer approach (read each line, parse for the tab sepertor, put each part in it's respective element) but with all the array functions in 2005 there has to be an easier way.
If you do not mind writing the array in a binary format:
\\\
Dim a(,) As Integer = {{2, 4, 234234}, {4, 4, 9}, {4, 4, 9}}
FileOpen(1, "C:\foo.txt", OpenMode.Binary, OpenAccess.ReadWrite)
FilePut(1, a, 1)
Dim b(2, 2) As String
FileGet(1, b, 1)
FileClose(1)
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
On Sun, 27 Nov 2005 14:00:41 +0100, Herfried K. Wagner [MVP] wrote: "al jones" <al**********@shotmail.com> schrieb: I'm trying to get something to work here and not having much luck. I can take the sledgehammer approach (read each line, parse for the tab sepertor, put each part in it's respective element) but with all the array functions in 2005 there has to be an easier way. If you do not mind writing the array in a binary format:
\\\ Dim a(,) As Integer = {{2, 4, 234234}, {4, 4, 9}, {4, 4, 9}} FileOpen(1, "C:\foo.txt", OpenMode.Binary, OpenAccess.ReadWrite) FilePut(1, a, 1) Dim b(2, 2) As String FileGet(1, b, 1) FileClose(1) ///
Thanks for the response HKW, but nope, I need a text file :). Sorry if
that sounds abrupt.
I'm trying to wwrite a 'small' program that will sort fonts into folders.
I can locate the foundry and the designer of a particular font within the
font file. What I want to do then is search the first element of the array
for what I've found and then use the second element as the name of the
folder into which to put the font. The reason, in particular, for the text
variety is that I have a couple of friends who want to be able to
manipulate the output folders.
What I have so far looks like: Using MyReader As New _ Microsoft.VisualBasic.FileIO.TextFieldParser("C:\f ontmover\foundries.txt") MyReader.TextFieldType = FileIO.FieldType.Delimited MyReader.SetDelimiters(Chr(9)) Dim currentRow As String() While Not MyReader.EndOfData Try currentRow = MyReader.ReadFields() Dim currentField As String For Each currentField In currentRow this line arFoundry.add[intcounter,0]=currentrow[0]
MsgBox(currentField) Next Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineExceptio n MsgBox("Line " & ex.Message & _ "is not valid and will be skipped.") End Try End While End Using
Stolen right out of MSDN - but I can't see how to do the equivalent of
somearray(index1, index2) = somevalue
I haven't felt the need to code anything for years - and this came up in
discussion as an interesting exercise - that's about to drive me to the gin
bottle!
Appreciate any suggestions //al This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Row |
last post by:
HI,
I would first like to say its been about 3 years since looking at java
im very rusty!
I have to write a post it notes type applet which will function
online. (reading from a flat text file)...
|
by: Yeow |
last post by:
hello,
i was trying to use the fread function on SunOS and ran into some
trouble.
i made a simple test as follows:
i'm trying to read in a binary file (generated from a fortran code)
that...
|
by: T Cordon |
last post by:
I am using a StreamReader to read text from an HTML file and display it as
part of a page in a Label Control. Buy it is not displaying characters as:
ñ, ó, ú, etc.
Please Help.
Thanks
|
by: John Dann |
last post by:
I'm trying to read some binary data from a file created by another
program. I know the binary file format but can't change or control the
format. The binary data is organised such that it should...
|
by: nuke1872 |
last post by:
Hello guys,
I have a file names network.txt which contains a matrix.
I want to read this matrix as store it as an array.
I am new to stuff like these...can anybody help me out !!
Thanks
nuke
|
by: bbepristis |
last post by:
Hey all I have a wired issue I have a csv file with , seperated values
I have some code to read the file and put the record into an array then
into textboxes. the problem is it seems to read...
|
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;
|
by: GeoUK |
last post by:
Hi All,
New member here with a bit of problem. I have read the FAQ's and searched text books but still cannot solve the problem that I have.
As part of a course I am doing at University I had...
|
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...
|
by: stoogots2 |
last post by:
I have written a Windows App in C# that needs to read a text file over the network, starting from the end of the file and reading backwards toward the beginning (looking for the last occurrence of a...
|
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,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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,...
|
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...
| |