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




How To Save The Information To A Notepad Text File


Hai,
I have certain information, i need to create a new notepad text file and save the information to that note pad text file, how do i do that. Please help me, Thanks in advance...




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Save And Load Information To And From A Simple Notepad File. <<RESOLVED>>
Hello everyone and thanks for the help ahead of time. This is my very first post, so it might not be up to your standards yet.
But I'll Try!

I have been reading Visual Basic 6 for Dummies, (I know this is not the best source of info) but have recently lost the book. While reading it, I saw a piece of code describing how information from variables or strings (ie. text boxes, labels, and other variables) can be recorded or read from a Windows Notepad file(*.txt). At the time, I didn't think I would need it. Now that the book has been lost, I actually do need this information. I have looked at some of the other self-help sites and they are to advanced for my knowledge. I am obviously still very Newbie. If anyone can Explain it to me and/or possibly supply a Snippet of Code, I would greatly appreciate it.
Again thanks for the help.



If ever you need me, just look to the sky and shout my name.
~The Cloudman~


Edited by - The Cloudman on 5/25/2004 5:18:02 AM

How Do I Save Information Without Notepad?
Right now I know how to use StreamReader and StreamWriter but I would like to know if there is anyway to add information to just the program without having to read/write it to notepad or any other program.

How To Save/read Textbox Text To/from Notepad File
Pls show me that how to save/read textbox text to/from notepad file. urgent please help me......

How Save Text Box Information To File?
I know how to save information in a richtextbox to file, but the code doesn't work for a text box. Any suggestions?

Using VB To Save An Open Notepad File
Hi,

I was hoping someone might be able to help me with a quick question. I don't have any written code, sorry.

I used the macro recorder to try and save an open notepad file on my desktop but no code appeared in the vb module. Can this be done? I'm a little lost for ideas.
Any help would be greatly appreciated.

Thanks.

Auto Save Of Notepad File
i have an existing notepad file which will be opened manually and updated often by user. i want to save this from vb.. can anybody send the code for auto save the text file

How Do U Save Information From A Text Box....
I am making a simple program where it records what is typed into a Text Box and is saved to a text file. Does anyone know how to save the information from a Text Box into a text file? If so please let me know.

"I repeat: This is not a drill. This is the apocalypse. Please exit the hospital in an orderly fashion. Thank you."
-----------------------------------------------------------------------------------------------------------------------------

Help To Save Information To Csv File..
Hi, i require help with transferring information to a csv file. I have declared the variable at the top and used the following function:

Open "C:TheResults.csv" For Append As #1
Print #1, "1,"; colours
Close #1

Obviously, I have declared the colours as a string at the top. The user has to select 1 or more colours. But only 1 of the colours get saved, for example if the user selects orange, purple, green only green gets saved in the csv file cell.

the check boxes have the following code:

With ActiveDocument
If chgreen = True Then colours = "Green"
End With

and same goes with all of the other check boxes..

is there any way were i can get all of the information saved?

Thanks

External File Save Information In VB6
Hi there,
Is it possible to identify the last saved file (any format) from my vb program. My aim is whenever my programm is run i want to give a message that "The last file saved in your computer is xxxxx.xxx " . Please help

How To Save Form Information Not In A File?
I wish to save information like "Text1.Text" from inside the program and not in a file. But when you click on default settings then those settings will be lost.

Copy All Text From Textbox, Open Notepad, And Automatically Paste To New Notepad Shee
Hello everyone.

I am trying to copy all text, that is already in the textbox, to a new notepad sheet.

Example:

Step 1. Copy all text in Text1 box to clipboard.
Step 2. Open Notepad
Step 3. Paste clipboard to notepad.

All this should be done with one click of a button.

I get as far as copying everything to the clipboard, and it even opens up notepad, but I still have to manually paste (CTRL-V) into notepad.

I would even like it to ask me what name to save it as as well as where to save it at...just like the Save As function in Word or something.

Here is what I have so far.

Private Sub cmdCopytoClipboard_Click()
Dim MyAppID
Clipboard.Clear
Clipboard.SetText Text1.Text
MyAppID = Shell("NOTEPAD.EXE", 1)
AppActivate MyAppID
MyAppID = Clipboard.GetText()


End Sub

Can I Copy Excel File To Phase On Notepad Text File By Script??
Hello, I want to know that can I copy the excel file to notepad text file automatically????? By script,ok??

Open Text File With Notepad
I would like to open a text file with notepad or wordpad. I tried the shell-function. But that doesnt work.

bool = Shell(notepad "hallo.txt")

It once worked but I forgot how...
Please help!

Anita

Opening A Text File Using Notepad
I've made a help text file that I want to be accessed through the menu, and when the menu item is clicked. I'd like the text file to be opened in Notepad while my Visual Basic program is still running, similar to what would happen if you double clicked the text file in Windows Explorer. What sort of syntax do I need to use?

Open A Text File (in Notepad) From VB
Hello,

I want to open a specific text file from within VB. For example, by clicking a button. I have tried ShellExecute..but it does not seem to work.

Help.

Thanks!

Open Text File In Notepad
My application generates a number of .Log files. All are standard text files that I can easily view in Notepad. What I'd like to do is add a menu item which, from within my program, my user to open them and view them, in notepad. I've tried:
VB Code:
Shell "c:myfoldermylog.log", vbNormalFocus'and I have triedShell "notepad.exe c:myfoldermylog.log", vbNormalFocus
And neither one works. What am I doing wrong?

Open Text File With Notepad??
I've tried to open the text file with notepad with the
following command


ShellExecute(Me.hwnd, "open", "c: emp
eadme.txt", 0&, 0&, SW_SHOWNORMAL)

but it wouldn't do anything, I'm pretty sure in the register, the txt file is associated with notepad

Any idea?

Thank you in advance for any help!!

Open Notepad And Display Text Which Isn't In A File
How can I open notepad and display text which isn't in a file?

My prog processes an input file to create some output text.

I have a button
"open in notepad"

I want it to open notepad with the text but with no file name, as though a "new " had been selected from the File menu.


Thanks

Uploading Text From A Notepad File Onto Geocities??
Hi,

How do I upload text from a notepad file onto geocities(ftp://ftp.geocities.com)? Does it have something to do with the Inet control?

Open Notepad To View Text File
Can anyone please give me the code to open an existing text file to view in Notepad? Thanks in advance.

Question On Parsing Notepad Text File With VBA... Please Help
I just got tasked this at work and have a few questions. I found some code from someone at work that did something similar to what i am doing now. Essentially i have a document with requirements in it and some of those requirements have data that refers to definitions as well as some tables. The code that i had originally parsed through the requirements in notepad ( the person copied the relevant information into notepad and then ran his VBA code on that). I decided not to use the way that he did this because he took the information from the notepad file put it into Excel (through VBA) and then manually imported it into one of the applications that we use here. I want to write directly to the application rather than doing all that intermediary stuff. So i tried running my code, it opens the word file but then bombs out on the following line:

    Do While Not EOF(1)

What is the syntax to perform this using Word VBA, since this was originally done on a text file? The error that it gives me is: Run-time error '52': Bad filename or number.

Here is a blog of the code:
For k = 1 To 1
    Do While Not EOF(1)

        Line Input #1, textReq
        
        If (InStr(textReq, "3") = "1") Then
            If (name <> "") Then
                'exDocument.Worksheets(k).Cells(i, 1).Value = name
                'exDocument.Worksheets(k).Cells(i, 2).Value = description
                'exDocument.Worksheets(k).Cells(i, 3).Value = Rationale
                i = i + 1
            End If
            reqnum = Trim(Left(textReq, InStr(textReq, Chr(9)) - 1))
            name = "IC - " & reqnum & " " & Trim(Right(textReq, Len(textReq) - InStr(textReq, Chr(9))))
            Rationale = ""
            description = ""
        ElseIf (Left(textReq, InStr(textReq, ":")) = "Rationale:") Then
            Rationale = Trim(Right(textReq, Len(textReq) - InStr(textReq, ":")))
        'Else
            'description = description & Trim(textReq)
        Else
            description = description & Trim(textReq)
        
            If (Left(textReq, InStr(textReq, ".")) = "Table 3 " & tablenumber) Then
                tablenumber = tablenumber + 1
            End If
        End If

    Loop

Essentially all i want to do is search for a string of numbers (the requirement number) and the name is appended after that. Everything else until the next requirement number is either Rationale, description or a table. Currently the code shown was able to handle the Requirement number, rationale, and description and did not have any tables in it. The new document that i have received now has tables. What would be the easiest way to get those tables out of word and into our application. I was told to format the information using html or xml tags when a table is discovered in word and put it into our applicaiton that way. This way when the information is pulled back out of the application and into another word document it is already formatted and is readable, rather than being a continous text string which is what it looks like now when it is pulled out. I know that this is probably a bad description but i didn't want to go into all that much detail. If anyone can help me out on where to get information or some ideas i would really appreciate it.

thanks
Evan




Edited by - goodolE22 on 5/18/2004 8:05:00 AM

Showing The Content Of Notepad File In A Text Box Control
Hi all,

Hope all in fine tune. Here I am uploading a text file. What all I need is that I want to show the content of the file in text box control of a form with multiline set to true and scroll bars to both. But the contents are coming in the control but are compressed to a new line and the alignments are going off. My requirement is to show the contents exactly in the same way as it appears in the notepad file when maximized.Please help me as a project is withheld for this code.

Help me Plzzzzzzzzzzzzzzz

Thanx in advance

Text File Opening In Notepad Want To Open In Winword
Anyone

I've created a file in note pad
basically i want to open that same file in winword
How do i do it ?

Open "s.txt" for input as #1
Do until EOF(1)
Line Input #1, TMP$
Loop
Tmp$ = Tmp$ + vbcrlf$
CLose #1

Regds
Sam F

Is Any Api Function To Open Text File In The Already Launched Notepad.
Hi,

Is there any api function to open the 'c:abc.txt' text file in the already launched 'Notepad.exe' application.
Please give ur technical solution straitaway.

Note: without using the sendkeys() function.


Advance thanks
Adesh.
adesh@kmap.biz,adesh_y@yahoo.com

How To Save In A Notepad?
i have created a simple notepad using visual basic and i dont know how to
write the save codings under the menu bar/save

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

Create/save Txt To Notepad.
How do I createor save txt from like a textbox text to a notepad.txt with or withought openning it (if you can give me both ^.^ I Searched all over this forum, and didn't find anything like this question, if there is one, please give me the link. Thanks~

(idk if I not make sence is sentence, just really baked)

(VB6) Report To Save In A Notepad
Hon'ble gurus,
I use VB6 and MsAccess and DataReport. But the data I have in a table should be printed in a notepad. Is it possible to print the data in a notepad? How to show the columns and the space between columns in a notepad? Please guide me with code and I'll be very greatful to you. Thanks.



pkb_pkb

Save Running Notepad
hello all
i am working in a project in visual basic in which i hv to save any running notepad.
plz giv me a direction n reply soon if anyone can help me regarding this
thanks in advance

Saving Information To A Text File
I created a registration form in visual basic, and I wanted to know how to save the information to a text file?

Exporting Information To A Text File
Apologies if this is in the wrong forum.

I'm fairly new to VB and I'm making a small program for a class. I'm part of a group that goes around repairing and troubleshooting computers around campus. We needed a way to keep track of what we do, so I made a very small program in VB where it's a simple log of that. Basically it's a fill-in the blank type of thing, with a Cancel and a Print button at the bottom. You fill in the Teacher's Name, Room Number, Computer Model, etc. Then once that is all finished you click the print button and go file what was printed along with any other additional comments.

What I'm looking to do is export this information that is filled into these TextBoxes to a text file with a simple layout and a time/datestamp by pressing a CommandButton.

Can anyone help me out with this? It'd be a much cleaner way of filing these issues.

Appreciate help in advance,
colt

Stripping Information From A Text File
Hi,

I've got a text file and I want to strip out part of it and format it using VB6.

What I have is a series of tests (written in another language) and I want to strip out the numbers that follows '*/'.

I have a series of tests with the following header style:


--
TEST 10;
--
--"Test description entered here - omitted for commercial reasons"
--
--TEST TRACEABILITY:-Requirements:*/1806, */1881, */1807, */1807, */1661, */1662
--*/1663, */1666, */1667, */1668


How can I write a script which will search through this and relate the numbers to the tes number. I want an output to look like

Requirement Test
1806 10
1881 10
...
...

Can anyone advise me how to go about this as I don't know how to go about it.

Many thanks.

WW.

How Can I Use A Specified Information Saved In A Text File?
I have a program that uses this code to write the info entered by the user in a text file:


Quote:




Private Sub Command1_Click()
n = Text1.Text
a = Text2.Text

Open "h:RECORDS.txt" For Append As #7
Write #7, n, a
Close #7

MsgBox "Done!"

End Sub






I am using this code to put the first field (na) of info of the text file in a combobox:


Quote:




Private Sub Command2_Click()
Open "h:RECORDS.txt" For Input As #3
Do While Not EOF(3)
Input #3, na, ag
Combo1.AddItem na
Loop

Close #3






How can I make my program so it only goes to the next form (ex. form2) when the second field of info (ag) in the text file is entered in the second textbox (a)?

Pulling Information From A Text File
I'm looking to do the following task in visual basic 6 - and I don't know where to start. I've done simple programs before, but I could really do with a hand in the right direction. I currently have a text file, called roles.txt. This is generated from an ldapsearch, but that's irrelevant. These roles change daily and I'd like to create a VB application that will search through based on role name. Let me explain

cn=Role 1,ou=Services,ou=BPSS Application Services,o=accord,c=GB
objectclass=top
objectclass=applicationProcess
objectclass=AccordService
objectclass=nvdObject
cn=Role 1
edmpolicy=+PRIMARY.SASA.ZSERVICE.SE_VAT55_L01
edmpolicy=+PRIMARY.SASA.ZSERVICE.SE_V342G_L02

cn=Role 2,ou=Services,ou=BPSS Application Services,o=accord,c=GB
objectclass=top
objectclass=applicationProcess
objectclass=AccordService
objectclass=nvdObject
cn=Role 2
edmpolicy=+PRIMARY.BESPOKE.ZSERVICE.DW_ATS45_L02

The text file is full of literally thousands of these - each role has one or more edmpolicies attached to it - put simply I want to create an app where I can type the role name in a box, press go and it will tell me what the EDMPOLICIES are for that role. If it helps all roles are seperated by a space (like above)

Saving Information To A Text File
i want to save information from a textbox/es to a normal text file using vb6.

Retrieving Information From A Text File. THANK YOU!
I have a program that when data is input it will save that data in a txt file.

In theory it is suppose to retrieve the stored information every time I open the program. However when I close the program and re-open it the information is not retrieved only 0's in the locations the numbers need to be. When I edit that information it writes over the stored information which is what it is suppose to do but I need it to retrieve the information before I edit it.

Any help is appriciated

Saving Text Information In .avi File
I have some text information which i am able to save in .txt file through vb code, but how can i save this text information into .avi file or .mpeg file.

Changing Information In A TEXT File
I am attempting to save some user settings to a text file, then retrieving them as and when needed by my program. The problem is that VB over writes each file you try to add/change something. I know that you can copy the file into a temp file, and edit the text as it is going in, then delete the original file and rename the temp file to the original name (bad explanation sorry).

Now that I know the theory, I am sorry to say that I can not seem to get it to work. Here is what I have so far...

[VB]
Sub SaveAsFunc()
Dim F, Fs, G, TheFile, TempFile, File
TheFile = "config.ini"
TempFile = " emp.txt"
Set Fs = CreateObject("Scripting.FileSystemObject")
Set F = Fs.OpenTextFile(TheFile)
Set G = Fs.CreateTextFile(TempFile)

Do Until F.Line = 4
File = F.ReadLine
G.Write File
G.WriteBlankLines (1)
Exit Do
Loop

End Sub
[/VB]

After the loop I thought I could maybe use another loop to complete the rest of the file, but I think it is pointless in writing that when the first one doesn't even work.

Any help given will be appreciated
p.s.
If you post any code, could you please keep it as basic as possible and tell me what it is actully doing.

Output Information From A Text File?
I have a program which reads a text file, does a few check on the file, then outputs some of the file to a new location on my machine.

ie from c:input to c:output

I am stuck. The code will read the file but will not output it.
Ive attached my code, mycode.txt, and an example text file, prtrk.135, can anyone help me ? PLease.

heres some code i used before, using the system file object method, it worked but i need it to work using the code attached.

'Give the same name to the updated file
UpdatedFile = OutPutFolder & myFile.Name
'Writing updated contents in the newly created file
Set mf = objFile.CreateTextFile(UpdatedFile, True)
mf.Write strFileContents
mf.Close
Set mf = Nothing
'deleting the orginal copy of the file
Set OriginalFile = objFile.GetFile(myFile)
OriginalFile.Delete True
Set OriginalFile = Nothing

Load Information From Text File
I am writing a program that is going to be loading large amounts of
information for a user selected text file. What is the fastest method to
load from a text file? Scripting.FileSystemObject, Open Binary, etc.

Thanks in advance

Tom Bishop
email@removed
http://www.maxir.com

Writing Text Box Information To An XML File.
Hello All,

I need a little direction if possible. I have a VB 6 application that I am writing that has information populated into textboxes from either the users or the application itself.

Now what I need help on is that I would like to write all this information out to an XML file that I will later read into a web page for online reporting.

What is the best way to handle this? Any pointers would be most appreciated.

Cheers,
Thom

Highlight Incorrect Information From A File To A Text Box
Does anyone know how I could approach this one... or a good link for it.

I want to read a file and output the contents of it in a text box... but I want to say If the text box contains 4 alpha characters in a certain position then highlight it automatically. So output would be:

BOB*2333 S LANE*4454443333~
BLACK*MORE INFO*MORE INFO*INCORRECT INFO~
38798738*Y*N*BLAH BLAH*878*38799~
233*7744 E 158 ST*1234333222~
BLACK*MORE INFO*MORE INFO*INCORRECT INFO~
38798738*Y*N*BLAH BLAH*878*38799~
So I would want 233 highlighted because it needs to be a name or if it was blank - highlight the * before and after it. Or even just change the color.

I appreciate any help you can give me. I'm using VB6.0, thinking about using VB.Net and a pretty new programmer (obviously).

Thanks.

Text File Information Into Combo Boxes
Hi,

I have a text file which is set out as below.


Part1 |PartNumber1 |Details1
Part2 |PartNumber2 |Details2

How would load the columns into combo boxes and have it so that if i select part1 from the combo box the other combo boxes would update to show the correct data for that part?

Thanks

Stuart

Need A Script To Delete Information In A Text File
My text file has numerous lines formatted like the below data:

04/04/08 01:00:46 Data Received:1103 0026 7 8 07841480403
04/04/08 02:49:18 Data Received:1105 0055 7 8 07876241609

I need a script that would remove the date time and Data Received: portion of each line of the file then save the file. I will also need this process to be ran every  20 minutes and saved with the same file name everytime.

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



   
 

Open BIG Text File And List Information In ListBox1
Hello Programmers,
I want to know the best way to open a 20 MB text file and list lines in list1
I tried the simple method but the program got crashed
i want to store 20mb text lines in a listbox.
please advice
Ynzahaos

How To Create A Text File With Unique Header Information
Hello friends ,
i am creating a file file and adding a structure in that

code--> '''setting_rec_ip==> structure name
Open fileName& ".Tpl" For Random As #1 Len = Len(setting_rec_ip)
Put #1, 1, setting_rec_ip
Close #1
-->
the file has extension .Tpl.



And while openning the file-->
Open fileName For Random As #1 Len = Len(setting_rec_op)
Get #1, 1, setting_rec_op
Close #1


--- the problem is that if any body created a .Tpl file from textpad, that file is also get opened and and cause error!!!!

I want to create a file which has unique Header information.
plz tell me how to create such a file
hoppin best from u!
Thanks in advance!!!

Everytime I Save In A Notepad Im Also Saving The Double Quotation*****
i have some file that i saved in a notepad

everytime i saved info. in the notepad it saved as "NT1" or "N2" with double quotation ""

is there a way to save it without the double quotation?

and if there's no way i want to get only the words within the double quotation ("") how can i parse it...please help again

my code is like this

to save in a note pad

intFF = FreeFile
Open App.Path & "Lodgement.dat" For Output As #intFF
 Write #intFF, Parcelzone
Close #intFF


to open it is like this

how can i parse only the words within the double quotation("")
Dim tempstring As String, myVariable As String
   Open (App.Path & "Lodgement.dat") For Input As #1
     Do Until EOF(1)
     Line Input #1, tempstring
                       
   Loop
      
Close #1





Edited by - gracelle on 5/18/2004 7:58:36 PM

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