I'm assuming I can do this with AJAX (most likely not). But how exactly can I edit a notepad file (add stuff to it)? I don't want to do this on my server, just on my pc.
I'm assuming I can do this with AJAX (most likely not). But how exactly can I edit a notepad file (add stuff to it)? I don't want to do this on my server, just on my pc.
- Mike
Without ActiveX or Java, you can't.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Thanks. So how can I use Java to do this?
- Mike
Or php...
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
The above code should write into a txt file though not tested.Code:import java.io.*; class one { public static void main() { try { BufferedWriter out = new BufferedWriter(new FileWriter("t.txt", true)); out.write("aString"); out.close(); } catch (IOException e) {} } }
Depending upon how and when you want to add stuff to a notepad file and where you want to get that stuff from, batch programming might be your best bet.
By the way, a notepad file is only an ordinary text file.
This batch file:
Call it - make_js.bat - will create or overwrite a javascript (an ordinary text file) file that when linked to a given HTML page will then create an array of images (with one extra entry that can later be trimmed using javascript) from the directory using the localhost absolute path (red) of one's choosing.Code:@echo off echo fadeimages=[ > test_it.js for %%p in (*.jpg, *.gif, *.png) do echo 'file://localhost/C:/internet/project/files/%%p', >>test_it.js echo 'end'] >>test_it.js
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Actually, about php-- if you're talking about a local file, it won't work. As Twey said, ActiveX and Java (and I believe flash, if it has special permissions and complex code) are the only ways to modify an existing text file on your harddrive. I misread the original post, sorry.
PHP (as well as other server side languages-- CGI/ASP/etc.) can, though, on the server (or just output to the user).
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
The signature for main isCode:import java.io.*; class one { public static void main(String[] args) { try { BufferedWriter out = new BufferedWriter(new FileWriter("t.txt", true)); out.write("aString"); out.close(); } catch (IOException e) {} } }If the signature isn't matched, main won't be called.Code:public static void main(String[])
Of course, if you're just seeking to automate the creation of a large text file, John's batch file idea will work fine.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
I knew about the batch file way, but I was trying to mix it into a webpage, and that I'm aware of, bat files can't be encorperated into webpages![]()
- Mike
I want to get input from the user too, then add to a .txt file
- Mike
Bookmarks