Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

writing a matrix to a txt file

Status
Not open for further replies.

carlasilva

Programmer
Jan 6, 2003
12
0
0
PT
Hi!
I would like to write a two-dimensional matrix in a text file. So the first line of the test file is the first line of the matrix.
How must I programme this? So far I just know how to write a single column.

Best regards,
Carla Silva
 
Could you tell us, what code you cirrently have for writing the First Column?

If you try something like this, keeping your original first column code and simply adding to it, maybe it will work, if not post the code you have and I'm sure we'll find something between us all...

Example. (Using the File I/O Functions built into VB)

[tt]
Dim FileNo as Integer

FileNo = Freefile

Open "C:\OUTPUT.TXT" for Output as #FileNo
Print #FileNo, 1, strColumn1 & "," & strColumn2
Close #FileNo
[/tt]

N.B. THIS WILL NOT WORK WITHOUT MODIFICATION IN YOUR PROGRAM

Hope this helps, and don't forget, post your code.






jgjge3.gif
[tt]"Very funny, Scotty... Now Beam down my clothes."[/tt]
 
Hi! Now the problem is solved:

i = 0
Open FicheiroEscreverTemperatura For Output As #1
Do While i < nnes
Print #1, i,
For j = 0 To nnos - 1
Print #1,Tw(j, i),
Next j
Print #1, &quot;&quot;
i = i + 1
Loop
Close #1


But how do I control the decimal cases after the commas to be displayed?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top