Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Save Array Into The Text File


Hi:

I open a text file that has data in it to store into an array:

"L666","Surge Protector","PC King","3.30","160","N"
"M013","MS Mouse","Memory Rex","23.22","28","N"
"H013","20 GB Hard Disk","Micro Shop","190.00","18","N"
"L005","17' Monitor","King","305.00","4","N"
"M713","56 K Baud Modem","Memory Rex","99.00","88","N

into an array:

ProductArray(iCounter, 0)
ProductArray(iCounter, 1)
ProductArray(iCounter, 2)
ProductArray(iCounter, 3)
ProductArray(iCounter, 4)
ProductArray(iCounter, 5)

but when I save it using Common Dialog Box to the text file, it looks like this in the text file:

L666 Surge Protector PC King 3.30 160 N
M013 MS Mouse Memory Rex 23.22 28 N
H013 20 GB Hard Disk Micro Shop 190.00 18 N
L005 17' Monitor King 305.00 4 N
M713 56 K Baud Modem Memory Rex 99.00 88 N


I don't know why:

here is my code for the Save:

Private Sub SaveProduct()
Dim iCounter As Integer
Dim FileNumber As Integer

' If there is nothing in the Inventory File then Exit the subroutine



If UBound(ProductArray) = 0 Then
Exit Sub
End If


FileNumber = FreeFile
CommonDialog1.Filter = "Text files (*.TXT)|*.TXT"
CommonDialog1.ShowSave
If CommonDialog1.FileName <> "" Then
Open CommonDialog1.FileName For Output As #FileNumber ' OPEN the path to the Addressbook database for Output to the file variable

' For each item in the Inventory File variable
' Write each item to the text file


For iCounter = 1 To UBound(ProductArray)

Write #FileNumber, ProductArray(iCounter, 0), ProductArray(iCounter, 1), ProductArray(iCounter, 2), ProductArray(iCounter, 3), ProductArray(iCounter, 4), ProductArray(iCounter, 5)

Next iCounter
LockupTextBoxes
cmdSubmit.Visible = False
cmdEdit.Caption = "Edit Record"
Picture1.Cls
cmdPrint.Visible = True
Close #FileNumber
End If
End Sub




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Save Array Into The Text File
Save array into the text file
Hi:

I open a text file that has data in it to store into an array:

"L666","Surge Protector","PC King","3.30","160","N"
"M013","MS Mouse","Memory Rex","23.22","28","N"
"H013","20 GB Hard Disk","Micro Shop","190.00","18","N"
"L005","17' Monitor","King","305.00","4","N"
"M713","56 K Baud Modem","Memory Rex","99.00","88","N

into an array:

ProductArray(iCounter, 0)
ProductArray(iCounter, 1)
ProductArray(iCounter, 2)
ProductArray(iCounter, 3)
ProductArray(iCounter, 4)
ProductArray(iCounter, 5)

but when I save it using Common Dialog Box to the text file, it looks like this in the text file:

L666 Surge Protector PC King 3.30 160 N
M013 MS Mouse Memory Rex 23.22 28 N
H013 20 GB Hard Disk Micro Shop 190.00 18 N
L005 17' Monitor King 305.00 4 N
M713 56 K Baud Modem Memory Rex 99.00 88 N


I don't know why:

here is my code for the Save:

Private Sub SaveProduct()
Dim iCounter As Integer
Dim FileNumber As Integer

' If there is nothing in the Inventory File then Exit the subroutine



If UBound(ProductArray) = 0 Then
Exit Sub
End If


FileNumber = FreeFile
CommonDialog1.Filter = "Text files (*.TXT)|*.TXT"
CommonDialog1.ShowSave
If CommonDialog1.FileName <> "" Then
Open CommonDialog1.FileName For Output As #FileNumber ' OPEN the path to the Addressbook database for Output to the file variable

' For each item in the Inventory File variable
' Write each item to the text file


For iCounter = 1 To UBound(ProductArray)

Write #FileNumber, ProductArray(iCounter, 0), ProductArray(iCounter, 1), ProductArray(iCounter, 2), ProductArray(iCounter, 3), ProductArray(iCounter, 4), ProductArray(iCounter, 5)

Next iCounter
LockupTextBoxes
cmdSubmit.Visible = False
cmdEdit.Caption = "Edit Record"
Picture1.Cls
cmdPrint.Visible = True
Close #FileNumber
End If
End Sub

Save An Array To A Text File
Good Day!
I am currently developing a testing system that is designed to test the knowledge level in the university/school. This is a non-commercial product for my personal usage. It is composed of two main parts:
1. Test Writer - the module that can compose tests.
2. Test Executor - the module that performs the testing process.

At this moment I develop the Test Writer. Here is the main form:


Here is the full application code:
Option Explicit
Private lngIndex As Long
Private arData() As String

Private chkIndex As Long
Private chkData() As String
Function LoadQuestion()
Dim arTmp() As String
    Text8.Text = lngIndex
    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
    Text5.Text = ""
    Text6.Text = ""
    Text7.Text = ""
    Text9.Text = ""
    arTmp = Split(arData(lngIndex), ";")
    If UBound(arTmp) = -1 Then Exit Function
arData(lngIndex) = ""
    Text1.Text = arTmp(0)
    Text2.Text = arTmp(1)
    Text3.Text = arTmp(2)
    Text4.Text = arTmp(3)
    Text5.Text = arTmp(4)
    Text6.Text = arTmp(5)
    Text7.Text = arTmp(6)
    Text9.Text = arTmp(7)
End Function

Private Sub Form_Load()
ReDim arData(1 To 9999)
    lngIndex = 1
    'Ïîêàçàòü òåêóùèé âîïðîñ
    LoadQuestion
    
ReDim chkData(1 To 9999)
    chkIndex = 1
    LoadCheck

End Sub


Private Sub cmdPrev_Click()
    If lngIndex = 1 Then Exit Sub
    arData(lngIndex) = Text1.Text & ";" & Text2.Text & ";" & Text3.Text & ";" & Text4.Text & ";" & Text5.Text & ";" & Text6.Text & ";" & Text7.Text & ";" & Text9.Text
    lngIndex = lngIndex - 1
    LoadQuestion
    
     If chkIndex = 1 Then Exit Sub
    chkData(chkIndex) = Check1.Value & ";" & Check2.Value & ";" & Check3.Value & ";" & Check4.Value & ";" & Check5.Value & ";" & Check6.Value
    chkIndex = chkIndex - 1
    LoadCheck
End Sub

Private Sub cmdNext_Click()
    If lngIndex = UBound(arData) Then Exit Sub
    arData(lngIndex) = Text1.Text & ";" & Text2.Text & ";" & Text3.Text & ";" & Text4.Text & ";" & Text5.Text & ";" & Text6.Text & ";" & Text7.Text & ";" & Text9.Text
    lngIndex = lngIndex + 1
    LoadQuestion
    
      If chkIndex = UBound(chkData) Then Exit Sub
    chkData(chkIndex) = Check1.Value & ";" & Check2.Value & ";" & Check3.Value & ";" & Check4.Value & ";" & Check5.Value & ";" & Check6.Value
    chkIndex = chkIndex + 1
    LoadCheck
End Sub


Private Sub LoadCheck()
Dim chkTmp() As String
    Check1.Value = False
    Check2.Value = False
    Check3.Value = False
    Check4.Value = False
    Check5.Value = False
    Check6.Value = False
    chkTmp = Split(chkData(chkIndex), ";")
    If UBound(chkTmp) = -1 Then Exit Sub
arData(lngIndex) = ""
    Check1.Value = chkTmp(0)
    Check2.Value = chkTmp(1)
    Check3.Value = chkTmp(2)
    Check4.Value = chkTmp(3)
    Check5.Value = chkTmp(4)
    Check6.Value = chkTmp(5)
End Sub

I would like to save the array indicated here in a file. Please, publish the code-solution for this problem (code-snippet) and a short explanation. If you know such kind of systems, please publish their names and links.
Thank You!

Help!! I Need To Save The Contents Of My Array To A Text File!!! VB6
This is my statement:


If (MsgBox("Are you sure?", vbYesNo) = vbYes) Then


dlgSave.Filter = "Text Files(*.txt)|*.txt|All Files(*.*)|*.*"
dlgSave.DialogTitle = "Select Your File?"
dlgSave.FileName = ""

dlgSave.ShowSave
dlgSave.InitDir = App.Path

intFileNum = FreeFile
Open dlgSave.FileName For Output As #intFileNum
I = 1
For I = LBound(MyArray) To UBound(MyArray)
ReDim Preserve MyArray(I)
Print #intFileNum, MyArray(I).A, MyArray(I).B, MyArray(I).C, MyArray(I).D, MyArray(I).E, MyArray(I).F
Next I
Close #intFileNum
End If

i run the program and choose the output file that iwant. After i choose the file i go and open it to see the output and it is just a line of 0's. Why is this?
thanks

Fastest Way To Save/retrieve Array Of Text From File
Ok, I have a huge list of files and some data about each and I need to save this to a text file then open it again and load it into an array again. I tried saving it as a | delimited text file, but when I try to read it back into an array, the Split() function is SO SLOW! I'm waiting up to 7 minutes to do this and I need to cut it down as much as possible. I either need the fastest way to split a text file by a character (load into a string? directly from file?) or a new way of storing this info. Thanx!

Save Array Data As A Text File Of 65 Characters Lines
Um Ubound(M) 'where M() is an array of bytes.
To save content of M as a text file where lines are 34 characters each(the last one will be 34 chrs or less), I can write the following code:

Open MyFile For Binary As #1
rew = StrConv(M, vbUnicode)
For i = 0 To (Um + 1) 34 - 1
Put #1, , Mid(rew, i * 34 + 1, 34) & _ vbCrLf
Next i
Put #1, , Right(rew, Len(rew) Mod 34)
Close #1

AY mentionned the CopyMemory function but I can't make it work if original data is contained in an array

thank you

Save Text In Textbox To Array
Hi all

I was wondering how exactly do i save text , that is entered into a textbox to an Array by clicking a command button? I have tried using really basic coding
What i want it to do here is basically save text that is entered into the texbox for
Student(0)
Student(1)
and Student(2)
The problem im getting is that whatever is entered into the textbox saves in every array position! not individually ...

Dim Student(2) As String


Private Sub cmdStore_Click()
For i = 0 To 2
    Student(i) = txtEnter.Text
    txtDisplay.Text = Student(2) ` i used this as a checker basically , to see whether it                     displayed correctly
Next i

End Sub

As soon as i enter text in the textbox the Displayer displays what i entered.. but it shoudlnt because i said it to display Student(2) , which is what will be entered lastly ... but yea , its in a loop so im not really sure how to end it as well....
its a really simple problem , but ive probably made it stupidly complicated ....

Thanks

I Have An Array Of Bytes To Save To Disk As Text...
how can i parse at 10 chrs per line (CRLF...)?

Open MyFile For Binary as #1
Put #1,, MyArray 'can I add parameters there?
Close #1

...? thank you

How Can You Open A Text File, Randomize Order, Save Text File Again?
Lets say you have 3000 items in a txt file

how can you open the file, randomize the order of the 3000 items and save it again?

Is There Any Wany To Save ASCII Text File Into UNICODE Text File Thru VB6?
Hi there,

I have a text file in ASCII and I want to save this text file as UNICODE text file thru VB6. Is this possible from VB6, if so, please help me how to do this?

thanks in advance.
regds.
Chandra

HELP... Save An Array To File.
hi...

I am trying to save an array to a file "c:customers.txt"... At run time it all works fine, but looking at the actaul file, nothing is actauly saved, and when I restrat the program, its all gone (no... im using append, not output too :P )

Im using similar to thisOpen "C:customers.txt" For Input As #1
counter1 = 0
counter2 = 0
Do While Not EOF(1)
Input #1, customers(counter1, counter2)
counter1 = counter1 + 1
counter2 = counter2 + 1

Loop
Close #1

And chaning to Append where nessesary... What am I doing wrong ??

Thanks in advance

SAVE ARRAY INTO FILE
Hello !
I have an array with 14 columns and variable number of rows.
I want to save that array into a binary file and to load it back to memory.
That array must be loaded corectly (the load function must know the number of rows and columns)
The content of the file must not be readable with a text viewer.

Can you help me please !
Thank You Very Much !!

How Can You Save An Array(strings) To A File?
with each string in the array on each line?

Save/load An Array To/from File?
I have a 4-dimensional array in my program to store various constants. I would like to be able to save and load this array to/from a file to preserve the constants between program executions. I do not want to change the implementation (i.e. replacing the array with some other data structure).

I use VB6.

Thanks in advance for any and all help!

Save Byte-Array To File
Hi,

how can I save a Byte-Array to a file?

With


Code:

open fname for binary access write as fno

for i = 1 to max

put #fno,1,myArray(i)

next i

close #fno


i always get a file with only 3 bytes (i have solved the problem by creating a string of the byte-array, but when i save a string with "for output" a paragraph is added at the end!)


Thanks
Thomas

How To Combine Byte Array And Save To A File?
Hi All,

I am trying to figure out on how to combine 2 byte array and save to a file.

e.g.
open "image001.bmp" for binary access write as #1
put #1,,x() & y()
close #1

notes : x() and y() contains bitmap binary data.

Appreciate any helps.

Kee

How To Save/load An Array To/from A *.txt File (unresolved)
here is my code which has
1 grid lovingly named grid and a array named CurData

how do i save the array to a txt file and how would i load it

Code:Private Sub Form_Load()
    Call Titles
    Call FillCells
End Sub

Private Sub Titles()
    Dim X As Long
    Dim Y As Long
    
    With Grid

    For Y = 1 To 4096
      .RowHeight(Y) = 260
      .Col = 0
      .Row = Y
      .Text = Hex$(Y - 1)
      .CellAlignment = flexAlignCenterCenter
    Next

    For X = 1 To 16
      .ColWidth(X) = 450
      .Col = X
      .Row = 0
      .Text = Hex$(X - 1)
      .CellAlignment = flexAlignCenterCenter
    Next
    .ColWidth(0) = 450
  End With
End Sub

Private Sub FillCells()
    Dim CurData(4096, 16) As String
    Dim Row As Integer
    Dim Col As Integer
    
    For Row = 1 To 4096
        For Col = 1 To 16
           CurData(Row, Col) = "FF"
        Next Col
    Next Row

    For Row = 1 To 4096
        For Col = 1 To 16
            Grid.Row = Row
            Grid.Col = Col
            Grid.Text = CurData(Row, Col)
        Next Col
    Next Row
End Sub


i dont have my files with me, the disk i had has errors. anyway i had a save function in one of the forms
but i figure saving it to a file would be the same as sending it to a grid except that i use
Code: print #FileNum, CurData(Row, Col) ' some where in there



for example:                                    
Code:Private Sub Command1_Click()
Dim myFileName As String
Dim FileNum As Long
FileNum = FreeFile
Dim Row As Integer
Dim Col As Integer


With CommonDialog1
    myFileName = ""
    .Filter = "All Files (*.*)/*.*"
    .ShowSave
    myFileName = .FileName
End With

If myFileName > "" Then
    Open myFileName For Output As FileNum
    For Row = 0 To 4095
        For Col = 0 To 15
            Print #FileNum, CurData(Row, Col), ;
            If Col = 15 Then
                 Print #FileNum, vbCrLf
        Next Col
    Next Row
    Close FileNum
End If
End Sub


does anyone know if this would work? plus i still dont know how to open a file.......
If i saved using this procedure. how would i load it agian????
im not to good with common dialogs. begginer programer. Any ideas???

Signature -----------------------------------------------------------------------------------------------------Code:Private Sub Form_Load() 'Print to from, code my problems!
     Form1.Print "CanT SleeP!..... MusT PrograM!!!" & vbCrLf & "I need coffee, WhErE iS mY CoFfEe?!"
End Sub 'All things come to and end
------------------------------------------------------------------------------------------------------------------

Edited by - coma on 11/13/2003 1:05:03 PM

Parsing Specific Text Pattern From A Text File And Save It On Excel Format
I just registered as a new member for this forum....i'm only starting to learn VB and hope i can get more information and tips from you guys. Anyone here can help me how to parse specific text pattern and save it on an Excel file?....

Example:

My text file would look like this:

-/--------------------------------------------------------/
Device_name : W8510HA7-BAN-C
Lot No. :14023562.1-Q45218.1
TestProgram :W8510A7_REV06_100C

          S/W H/W QTY PCNT TEST ITEM
 FAIL 12 25 12 10.00% Leakage Fail
 FAIL 13 26 42 42.02% bandgap Test Fail
 FAIL 14 27 100 70.11% scan_core Fail
                          
-/---------------------------------------------------------/

I want to parse the value for the Device_name, Lot No., TestProgram and all others
like QTY and TEST ITEM into an predefined excel format( ex.A1evice_Name, A2:Lot No., ......etc).

I hope you can help....thanks!

Jhunne



   
 

Array (doesn't Add/edit/open/save To .txt File) How To?
I have established my array and the navigation buttons next and prev work. Main problem is that it won't add/edit/open/save to a .txt file) using the Common Dialog control. Here is my code......

Private Type Fault

regnumber As String * 10
username As String * 10
date As Date
campus As String * 15
roomnumber As String * 4
pcnumber As String * 4
description As String * 100

End Type

Dim FaultArray(0 To 100) As Fault
Dim AllFaults As Integer
Dim ThisFault As Integer
Dim FaultLength As Fault
Dim MaxRecord As Integer

Public Sub EnterFaultArray()

FaultArray(1).regnumber = "1"
FaultArray(1).username = "James"
FaultArray(1).date = "01/11/03"
FaultArray(1).campus = "Preston"
FaultArray(1).roomnumber = "311"
FaultArray(1).pcnumber = "43"
FaultArray(1).description = "Mouse not functioning"





FaultArray(2).regnumber = "2"
FaultArray(2).username = "Tania"
FaultArray(2).date = "04/11/03"
FaultArray(2).campus = "Brodmeadows"
FaultArray(2).roomnumber = "123"
FaultArray(2).pcnumber = "5"
FaultArray(2).description = "Computer crashes on start up"





FaultArray(3).regnumber = "3"
FaultArray(3).username = "David"
FaultArray(3).date = "05/11/03"
FaultArray(3).campus = "Preston"
FaultArray(3).roomnumber = "205"
FaultArray(3).pcnumber = "5"
FaultArray(3).description = "No sound coming out of speakers"





FaultArray(4).regnumber = "4"
FaultArray(4).username = "Peter"
FaultArray(4).date = "07/11/03"
FaultArray(4).campus = "Preston"
FaultArray(4).roomnumber = "253"
FaultArray(4).pcnumber = "24"
FaultArray(4).description = "Monitor showing funny colors"





FaultArray(5).regnumber = "5"
FaultArray(5).username = "Patricia"
FaultArray(5).date = "10/11/03"
FaultArray(5).campus = "Epping"
FaultArray(5).roomnumber = "112"
FaultArray(5).pcnumber = "1"
FaultArray(5).description = "Not connecting to Internet"





FaultArray(6).regnumber = "6"
FaultArray(6).username = "Tamara"
FaultArray(6).date = "13/11/03"
FaultArray(6).campus = "Epping"
FaultArray(6).roomnumber = "221"
FaultArray(6).pcnumber = "19"
FaultArray(6).description = "Keyboard faulty"





FaultArray(7).regnumber = "7"
FaultArray(7).username = "Dennis"
FaultArray(7).date = "13/11/03"
FaultArray(7).campus = "Greensborough"
FaultArray(7).roomnumber = "323"
FaultArray(7).pcnumber = "5"
FaultArray(7).description = "Not Printing, not connected to network"





FaultArray(8).regnumber = "8"
FaultArray(8).username = "Jessica"
FaultArray(8).date = "15/11/03"
FaultArray(8).campus = "Epping"
FaultArray(8).roomnumber = "32"
FaultArray(8).pcnumber = "15"
FaultArray(8).description = "Disk stuck in floppy disk drive"





FaultArray(9).regnumber = "9"
FaultArray(9).username = "Nick"
FaultArray(9).date = "19/11/03"
FaultArray(9).campus = "Preston"
FaultArray(9).roomnumber = "342"
FaultArray(9).pcnumber = "28"
FaultArray(9).description = "Wont open word application"





FaultArray(10).regnumber = "10"
FaultArray(10).username = "John"
FaultArray(10).date = "21/11/03"
FaultArray(10).campus = "Greensborough"
FaultArray(10).roomnumber = "211"
FaultArray(10).pcnumber = "3"
FaultArray(10).description = "Jammed CD rom drive"

End Sub

Private Sub ArrayShow(index As Integer)

txtregnumber = FaultArray(index).regnumber
txtusername = FaultArray(index).username
txtdate = FaultArray(index).date
txtcampus = FaultArray(index).campus
txtroomnumber = FaultArray(index).roomnumber
txtpcnumber = FaultArray(index).pcnumber
txtdescription = FaultArray(index).description

End Sub
Private Sub cmdexit_Click()
End
End Sub

Private Sub cmdclear_Click()
txtregnumber.Text = " "
txtusername.Text = " "
txtdate.Text = " "
txtcampus.Text = " "
txtroomnumber.Text = " "
txtpcnumber.Text = " "
txtdescription.Text = " "
End Sub

Private Sub cmdfirst_Click()

cmdfirst.Enabled = False

End Sub

Private Sub cmdlast_Click()

cmdlast.Enabled = False


End Sub

Private Sub cmdnext_Click()

If ThisFault = MaxRecord - 1 Then
cmdnext.Enabled = False
Else
cmdnext.Enabled = True

End If

ThisFault = ThisFault + 1
ArrayShow (ThisFault)

cmdprevious.Enabled = True

If Val(ThisFault) = Val(AllFaults) Then
cmdnext.Enabled = False
End If
End Sub

Private Sub cmdprevious_Click()
If ThisFault = 1 Then
cmdprevious.Enabled = False
End If
ThisFault = ThisFault - 1
ArrayShow (ThisFault)

End Sub

Private Sub Form_Load()

Call EnterFaultArray
Call ArrayShow(1)
ThisFault = 1
cmdprevious.Enabled = False


End Sub

Private Sub cmdopen_Click()
Dim openfile As String, Item As String
Dim i As Integer
CommonDialog1.CancelError = True
On Error GoTo CancelButton
CommonDialog1.Filter = "Text files (*.txt)|*.txt"
CommonDialog1.ShowOpen
openfile = CommonDialog1.FileTitle
Open openfile For Input As #1
i = 0
Sum = 0
Do Until EOF(1)
Input #1, FaultArray
Sum = Sum + FaultArray
Loop
Close #1
i = i + 1
n = i

Close #1
CancelButton:

Exit Sub


End Sub

Private Sub cmdsave_Click()
Dim NewFile As String
Dim Fault As Fault, ThisFault As Integer

CommonDialog1.CancelError = True
On Error GoTo CancelButton
CommonDialog1.Filter = "Text File (*.txt)|*.txt*"
CommonDialog1.ShowSave
NewFile = CommonDialog1.FileName
Open NewFile For Random As #1 Len = Len(FaultArray(1))
Put #1, ThisFault, FaultArray(ThisFault)
ThisFault = 1

CancelButton:
Exit Sub
End Sub


I have an cmdadd,cmd,modify,cmdopen,cmdsave that are all not working. Can anyone help??

My Mind Has Gone Blank, How I Do I.. {save / Load Array From File}
load files into an array and get my program to save it?

My array is of dimensions 36,3 (36 different people with three pieces of information for each person...)

Fastest Way To Save/load Variant Array To/from File
A have a variant array that could be one or two dimensions, could hold any data type, and I want to be able to save it to a file and read it back in from that file as quickly as possible.

What's the absolute fastest way to do this? I don't much care what the actual file format ends up being. (Text, binary, whatever.)

Save Control Array Picture To File. [Solved]
Hi ya,

Is there any method i could save all my control array pictures to files? Say i have picture(20), how can i save them to file by a loop?

'SavePicture picture (i) .Image, "c:projectpicture (i) .jpg"

How can i change the filename in the loop? Say first time i need the filename is picture1.jpg, second time ineed the filename is picture2.jpg .. ..

Thanks a lot!!

Cheers!

Need To Append A Text File (delete Some Text Then Save)
Using VB.Net
Im trying to open a text file, Delete all text beginning with "Game St" and Ending in "ths )". (this includes all text in between).
Then save the textfile with changes.
Ive exhausted all brain cells trying to do this.
code help here please?

Save Last Line In Rich Text Box To Text File
From previous post - poor description

I have a Rich Text Box in which I load a log file (text file) for viewing & editing purposes. I would like to be able to save the file that is currently displayed as well as write the last line( the last line only, the line that the operator appended with a time stamp of completion), to be appended to the end of another text file file, that will be printed & cleared on a weekly or monthly basis.

Can anyone help me?

Save Text From Two Text Boxes Into 1 Text File?
I have two text boxes. Is it possible to save Text1 and Text2 into the same file, so that the new text file containing both Text1 and Text2's text will be like:

This is the text from Text1's text box

And this is Text2's text

Making a new line to seperate them, if you know what i mean?

How Can I Save A Text File With Bold Text In It
Hy... i have to make a report and write something like this:

blah blah=value

and then open it in winword.

The opening part i know, but how can i save the file with this format?
I don't have a richbox control in my form and if it is possible i don't want to use one.
Thanks in advance.

Save Properties Of A TIFF File In A Text File
I am working on a GIS software and for that i need to have information about the TIFF image, though we have some image controlls but they don't work with TIFF images, So what i want, i want to have a text file in out put in the result of inputing the TIFF file, and i that text file i need height and weight of the image and other important information as well.

Aligment Of Excel File Run Out When Save As Text File
When i save an Excel file as a text file and then
open it using Notepad, the aligment as running away.
How can i solve this problem?

How To Save Something To A Text File.
i have a game im making, and when the user pushes a button i want the program to save a number (or anything else i want) to a textfile in the same folder. how do i achieve this? thanks.

How To Save Text File To Rtf
I have a long text file (up to 300 pages) that I am inputting, making changes and outputting to a text file. However, I want to save it in rtf so that I can add formatting. But I do not want to put it into a rich text box since it is so long. Do you know how I can convert and save it without using a rich text box?
Thanks,
Linda

Save To Text File
How do I save text from a text box in my form to a text file on a disk? Do I use a common dialog box for this? Thanks, Dennis

How To Save To A Text File??
hi,

i know that when you want to save to a file (text file propably) there are 3 ways, the first is the random access and the sequntial access..

i know how to do it in Random Access..

but i need to know how to do it in Sequential access which is line by line???

if yo ucan give me an example with somecomments it will good for me to understand it..

yours

Save To A New Text File ?
hi i was wondering if there is a way that i can make it so that if the user enters text into a regular text box (not a rich text box) if i can have it save what is in that box to a new text file that VB creates on runtime ? if there is a simpler way please share (not using rich text boxes though, regular ones). ANY HELP WILL BE GREATLY APPRECIATED !!

Save To Text File
I have a form with 6 arrays on the form. The arrays are setup in columns. I want to save the arrays to a text file. So far when I have saved info to a text file, I save the info by rows moving from left to right from the top of the form to the bottom. My question is can I save the info in the arrays by columns instead of by rows, saving from top to bottom moving from left to right. If I save this way will it display correctly when loading the form? Does this make any sence?

How To Save Text..(to A .txt File)
i have a form.
it involves a textbox and a button.

is there anyway that every time i click the button
it creates a log.txt file and stores what i write in the text box in the directory the compiled application is stored.
and every time i open the application and add more to it. it adds to what i have already inputed and not re-write it completely.

e.g:

november 1 2008:
hello.
november 1 2008:
hello again.
november 2 2008:
omg this is boring.

thanks . i really really need a way of doing this.

Save To Text File?
Hello,

I am wondering how I save the contents of a text box to a text file?

Like a command button:

Code:
"Text2" = C:"Text1".txt


And the actions would save the contents of "Text2" and save it under the name of what ever variable is in "Text1".txt

Thanks!

How To Save A .text File??
how?? n also how to save a .doc file

Save Var To A Text File?
I used to know this, but i forgot since i havent used VB in a while, this is what im using at the mo, but how would i use it as an array so it saves lots of variable to a line of a txt file? (var1 will go to line 1 of the txt file, var 2 to line 2 etc.)

Writing:


VB Code:
Open "c:TESTFILE.dat" For Output As #1Print #1, AnyStringClose #1



Reading:


VB Code:
Open "c:TESTFILE.dat" For Input As #1Input #1, StoredStringClose #1Text1.text = StoredString 'Stores data in a text box, facultativ  

How Do You Save A Text File
I am creating a text file and I've had a major brain fart.....I can't remember how to save it under a specific name. Can someone relieve me of this stress?

Thanks,
Jeff

Save Text File As UFT-8
I have downloaded the Simple Text Editor as a reference, and would like to ask if it is possible to add the saveFile function like the real notepad with encoding column as shown in my attached jpg.


Actually I am facing a problem, that the vb form output a text file in ANSI code (I use print/write function), therefore, Chinese cannot be displayed when the text file was imported to a html. And my final step is to open the output-textfile with a notepad, and save as a new file with changing the encoding to UFT-8 instead of ANSI. And so it works. However, is there any other way much convenient?

Save Into One Text File
Hello everybody :

I am doing one app , and I have one TextBox control in my dialog box , how to save its contents into one .txt file , as I am total newbie for VB programming , sincerely hope I can get ur help . Any code snippet or advice would be very appreciated .

Look forward to ur reply online......

Thank you in advance !

I Want To Save Text In A File That Cannot Be Opened
Hello,

I wish to save information in my textboxes in a file that cannot be viewed and edited like a txt file can be. I have noticed than information can be stored in .DAT files, how does this work?

Also how to bring menus up that can allow the user to name the file and therefore have multiple saves

Thank You

Save Text Box Data On A Txt File
Hi There,

Can someone please help me about Visual Basic 6. I am wanting to save data in a textbox, on a text file that is stored in my C drive by just clicking on a command button on the form. I'm new to VB thats why

I am having difficulty and was wondering if someone can send me some code that will allow me to do this.

Thanks
telos

Save / Load To Text File
Hi Guys,

I have a real big request.

I am totally stuck on how to write the contents of a text box to file, and load it back in at a later stage.

Could some one show me how to do it.

I have attached a form, which is highly simplified, but if some one could demostrate on it how to Save to file, and Load back, that would be great.

I need the option of when pressing save, to be able to select where it is saved to, and what to call it.

Many thanks

Kieran Grayy

PS: I only started VB a couple of weeks ago, and this isnt a school / uni project, its just for my football team - cheers

Save And Write From Text File
Hello,

I am new to this forum, and very new to the world of VB.

I have a series of text boxes on 3 forms that i want to save to a text file. However:

Each time i save them, i want to be able to specify a file name, so that it saves differently each time

Also, i want to be able to load them back, but have the ability to chose which file to load back in

Can someone advise me what to do. Im eager to get my project done and dusted

Thanks

Kieran

How To Save A Charactor Into A Text File
hi...
can anyone help me on how to save a charactor into a text file using vb???

Hwo To Save A Charactor Into A Text File Using Vb?
hi...
can any one tell me how to save a charactor into a text file using vb...
as i need to have the rondam charators with out repeating, i need to save the charator each time i enter, then do the comparison to prevent from repeating...

Save A Text File With Your Extension
how to save a text file with a specific extension (like *.BRP) using a commondialog control & richtextbox control ?

Save File And Sorting Text
hey evry1..im a vb newbie and i was thinking f u could help me w/ this:
how to display contents of a textfile in a sorted manner?
any help will be appreciated..

Save Flexgrid To Text File
Hello,

I need to create a text file with the contents of the flexgrid coluns and rows, with "," separation.

António Miranda

Copyright © 2005-08 www.BigResource.com, All rights reserved