Text file 'engineOnClose.txt'
I keep getting the following text file 'engineOnClose.txt' everytime I quit my browser. Does anybody know why I'm getting this file, as I've not see it before?
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class Test
public static void main(String[] args)
try
BufferedReader in = new BufferedReader(new FileReader("xxx.txt"));
int i = 1;
String line = in.readLine();
while (line != null)
System.out.println(i + ": " + line);
++i;
// Read next line
line = in.readLine();
in.close();
catch (IOException ioe)
System.out.println("An I/O exception occurred");
ioe.printStackTrace();
}Jesper
Similar Messages
-
Empty text files - dl.txt and t.txt
I recently found these files on my hard drive and wondered what they are. They are blank when opening in text edit. Could they be malware? I googles dl.txt and it seems to show up a lot in torrent sites. Neither me or my husband ever use these sort of sites.
Is it safe to delete these files (they are in the trash right now). Are there any other mysterious txt files I should be concerned about?
Thanks for the help!
KarenText files are not executable files so they are not going to do anything themselves. Short of having some sensitive info in them and you mailing them somewhere they aren't going to do anything.
One caveat in that statement. A text file could be an executable file but you would immediately know that because if you attempted to view it with a text editor it would look like gibberish to you, not a readable file. Further the executable flag needs to be set in the permissions. You can always view the permissions with the terminal ls command.
Here's some references about permissions:
Who Goes There? Understanding Permissions in UNIX
Understanding file permissions on Unix: a brief tutorial
Or just google "understanding unix permissions".
Note even if a text file is executable code, something or someone needs to launch it. For the case of "something" there would be other code somewhere in you system to do that. That other code would usually be launched from various places looked at when booting or logging in. Items that cause launches when booting will appear in the following directories:
/Library/LaunchAgents
/Library/LaunchDaemons
/Library/StartupItems
Items that are launhed when you log in are in,
your login items
~/Library/LaunchAgents (in your home directory)
It is your login items and all these directories you should first look at for possible malicious actions. You probably already have stuff in some of these already because some applications use them to start helper processes to do their work. Don't worry about what you currently see. Only worry if you suspect malicious or just plain unstable behavior. -
How can I create a Document object from a text file (myFile.txt)
Hi everybody:
Thank you for reading this message.
I am trying to find a method to convert a text file ( I have it in a File object) to a Document object.
I read the Java API but it is strange, I do not know if I have to create an AbstractDocument, it is really strange for me.
Any comment is welcome,
Regards,
JBDocument is an interface, and AbstractDocument is abstract, so you
can't create either of those directly. Assuming you are dealing with a
a plain text file, you could do something like
// Not catching any exceptions that get thrown
File file = /* file you already have */
String eol = System.getProperty( "line.separator" );
int eolLen = eol.length();
FileReader reader = new FileReader( file );
BufferedReader buffer = new BufferedReader( reader );
PlainDocument doc = new PlainDocument();
for ( String line = buffer.readLine() ; line != null ; line = buffer.readLine() ) {
int len = doc.getLength();
if ( len > 0 ) {
doc.insertString( len, eol, null );
len += eolLen;
doc.insertString( len, line, null );
}and now you have a document.
: jay -
I keep getting the following text file 'engineOnClose.txt' every time I quit my browser. Does anybody know why?
Followed txt messaging as per manual Reference chapter 9 and followed manual reference trouble shooting guide with negative results. Tried hard reset which also yielded negative results.
-
Loading text from a .txt file
I want to do something that should be VERY simple, but due to
Adobe's insistence on using #$%^ing tutorials instead of just
providing step by step instructions, it's very frustrating to
figure out how to do it.
All I want to do is load the contents of a text file into a
dynamic text field, but I can't figure out how to do it (I'm not
all that familiar with AS). I'm working with Flash 8. Please help.
Thanks.Create the dynamic text box, and name it schedule.
Then, in the frame on the timeline that the text box resides
in, the corresponding actionscript would be used to create a text
variable and assign the text from a txt file to it:
loadText = new LoadVars();
loadText.load("externalfile.txt");
loadText.onLoad = function() {
schedule.text = this.textbody;
Where does the "textbody" variable come from? In the external
text file (externalfile.txt in this example), you have a variable
called textbody, and the externalfile.txt should read along the
lines of:
textbody = "I'm the external text that needs to be read
in" -
How to read every line from a text file???
How can i read every line from my text file ("eka.txt")
now it only reads the first line and prints it out.
What is wrong with this?
import java.io.*;
import java.util.*;
class Testi{
public static void main(String []args)throws IOException {
BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
File inputFile = new File ("eka.txt");
FileReader fis =new FileReader(inputFile);
BufferedReader bis = new BufferedReader(fis);
String test=bis.readLine();
String tmp= "";
while((bis.readLine().trim() != null)) {
int spacefound=0;
int l=test.indexOf(" ");
for(int i=0;i<test.length();i++){
char c=test.charAt(i);
if(c!=' ') tmp+=""+c;
if(c==' ' && (spacefound<1) && !(tmp.equals(""))){
tmp+=""+c;
spacefound++;
if(tmp.length()==l) {
System.out.println(tmp);
tmp="";
spacefound=0;
if(tmp.length()<l){
for(int i=0;i<=(l-tmp.length());i++)
tmp+=""+' ';
System.out.println(tmp);Try this code, Hope it servers your purpose.
import java.io.*;
import java.util.*;
class Testi {
public static void main(String []args)throws IOException {
BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
File inputFile = new File ("Eka.txt");
FileReader fis =new FileReader(inputFile);
BufferedReader bis = new BufferedReader(fis);
String test=bis.readLine();
while(test != null) {
StringTokenizer st = new StringTokenizer(test," ");
while(st.hasMoreTokens())
System.out.println(st.nextToken());
test = bis.readLine();
}Sudha -
Sending a text file Client/Server problem
Hi,
I have two java classes (A.java and B.java). i would like to send the text file (something.txt) from A to B. Can somebody please show me how to do so? I know it is incomplete, but i really need help since im new to this. I dont know how to send and how to accept the file. Here is what i have so far:
import java.net.*;
import java.io.*;
import java.lang.*;
public class A {
private static String hostname; //host name
private static final int portA = 1111; //source port number
private static int portB; //destination port number
private static ServerSocket s;
private static Socket socket;
private static BufferedReader br;
String fileName = "something.txt";
public A () {
public static void send() {
System.out.println("Send method");
try {
System.out.print("> Enter Hostname: ");
hostname = br.readLine();
System.out.print("> Enter Port Number: ");
portB = Integer.valueOf(br.readLine()).intValue();
catch(IOException e){}
public static void main(String args[]) throws IOException {
import java.net.*;
import java.io.*;
import java.lang.*;
public class B {
private static String hostname; //host name
private static final int portB = 2222; //source port number
private static ServerSocket s;
private static Socket socket;
private static BufferedReader br;
public B () {
public static void recieve() {
//code to recieve the text file here?
public static void main(String args[]) throws IOException {
}I really appriciate any code to help me out. ThanksCheck out the link shown below:
http://forum.java.sun.com/thread.jsp?forum=33&thread=66616
If that doesn't answer your question, search this site for Upload
;o)
V.V. -
Reading a text file from a remote host. Authentication required.
Hi frnds,
I have to read a text file "config.txt" from a remote host "HOSTNAME". File is shared in a folder - "FOLDER" .
If the folder is shared with no password protection then it works. But if the folder is password protected the code is unable to read the file.
I know the UserName and PassWord of the shared folder. How to code for this.
I don't want to share the Folder to everyone without a password.
Kindly Help.
try {
FileReader fr=new FileReader("\\\\HostName\\folder\\config.txt");
BufferedReader br=new BufferedReader(fr);
String s=null;
while((s=br.readLine())!=null)
/* One line is read */
fr.close();
catch(Exception e)
throw new Exception("Exception in ConfigConstants."+e.toString());
urs
Mishraok.. let me define it clearly...
By using ftp as a protocol how can I read a text file
in remote machine........ kindly do reply....Have a look at this article:
http://www.javaworld.com/javaworld/jw-04-2003/jw-0404-ftp.html
and what are the prerequisities that are needed for
such a type of operation.....(At least) an FTP server should be running on the machine where the text file resides.
Message was edited by:
prometheuzz
Oh, you should have your keyboard fixed: the full stop key seems to be stuck, you have a lot of trailing ..... after each sentence. -
How can I open in java file a text file?
Hi !
For example I have a java file name Pencil.java and I have a text fie name Box.txt
I want like that if ( a == b ) {open Box.txt}
How can I do that ?
Thanks.Yes I want to see what this text file contains. Like clicking to a text file with mouse and opens. Then I can see what it contains.
I have a Java document Pencil.java and I have a text file Box.txt
I will write a java code in pencil.java ( that I dont know ). Then when I enter a number from keyboard with
Scanner write = new Scanner(System.in);
int a = write.nextInt()
if (a == b) { } opens Box.txt
For example
I write to command prompt
java pencil
It wants from me a number : I will enter 3.
It is same as b .
Then Box.txt file opens.
Edited by: zue on Jun 3, 2008 11:04 AM -
Following is the text file(ocr.txt) from which i am reading data,
Name: mark
Date:1/11/2008
PO:4859685
Following is the program,
import java.io.*;
import java.util.*;
import java.util.Scanner;
public class SkipWord {
public static void main(String args[])throws IOException{
FileReader fr = new FileReader("D:\\Kiran\\Programs\\ocr.txt");
BufferedReader br = new BufferedReader(fr);
String line = br.readLine();
String line1=br.readLine();
try{
Scanner s1=new Scanner(line).useDelimiter("\\s*name:\\s*date:\\s*po:\\s*");
System.out.println(s1.next());
System.out.println(s1.nextLine());
catch(NoSuchElementException e){}
Current output:
mark
But i want the output in the following way,
Expected output:
mark
1/11/2008
4859685
Please help me regarding this,its very urgent.
Thanks,
praveenString line=br.readLine();
String line2=br.readLine();
Scanner s1=new Scanner(line).useDelimiter("\\s*name:\\s*date:\\s*po:
s*");
System.out.println(s1.next());
System.out.println(s1.nextLine());
Scanner s2=new Scanner(line1).useDelimiter("\\s*date:\\s*");
System.out.println(s2.next());
System.out.println(s2.nextLine());
I tried this but i am getting same output
Just printing "Mark". -
Problem in text file to xml scenario
hi,
while executing the Flat file (txt) to xml file scenario, the txt file picked up from my source directory, but i could not find in my target directory.
when i check message monitoring, it is showing successful.
Audit Log for Message: af840930-3fa2-11dc-a345-000423c7753d
Time Stamp Status Description
2007-07-31 16:14:47 Success Channel CC_sender: Entire file content converted to XML format
2007-07-31 16:14:47 Success Send text file "xi_input.txt" from FTP server "64.72.230.130:/praba_source", size 353 bytes with QoS EO
2007-07-31 16:14:47 Success Application attempting to send an XI message asynchronously using connection AFW.
2007-07-31 16:14:47 Success Trying to put the message into the send queue.
2007-07-31 16:14:47 Success Message successfully put into the queue.
2007-07-31 16:14:47 Success The application sent the message asynchronously using connection AFW. Returning to application.
2007-07-31 16:14:47 Success The message was successfully retrieved from the send queue.
2007-07-31 16:14:47 Success File "xi_input.txt" deleted after processing
2007-07-31 16:14:47 Success The message status set to DLNG.
2007-07-31 16:14:48 Success The message was successfully transmitted to endpoint http://xiserver1:8000/sap/xi/engine?type=entry using connection AFW.
2007-07-31 16:14:48 Success The message status set to DLVD.
2007-07-31 16:14:48 Success The message was successfully delivered.
I followed the Venkat Donela blog
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
IN sender CC, i used file content conversion(mesage protocol), file name scheme xi_input.txt
In receiver CC , I used file (message protocol),file name scheme xi_output.xml
In both CC , transport protocol is FTP.
so i gave server name, port, username, password.
could you help me out to find the error for this scenario also?
Thanks in advancehi,
when i click on this adapeter engine xiserver1, it is changing to green color,
if i double click nothing is happening as u said
but it is showing like this Central CCMS monitor not available
anyway i giving all my values in sender CC:
in sender communication channel
TP : FTP
MP: File content conversion
AE: IS
File access parameters:
sD: /praba_source
FN: xi_input.txt
FTP access parameters:
server: xx.xx.xxx.xxx
port: xx
username: xxxxx
password: xxxx
connection mode: permanently
transfer mode: Binary
Processing Parameters:
QoS: exactly once
poll interval: 60
Processing mode: Test
File type: Binary
Content Conversion Parameters:
Document name dt_outbound
Document namespace urn:xxxxxx
record name: record
recordset str: row,*
recordset seq:Ascending
key fiedl type: string(case-sensitive)
name: value
row.fieldNames: FirstName,LastName,MiddleName,City,Place,State,Country
row.fieldSeperator: ,
row.processConfiguration: FromConfiguration
row.endSeperator: 'nl'
my input file which i kept in source directory is xi_input.txt
content of this file (xi_input.txt) is
Samuel,J,Jackson,Lakefront Drive,Earth City,Missouri,USA
Kenny,m,George,North Beauregard street,Alexandria,Virginia,USA
my dt_outbound structure like this,
dt_outbound (complex type)
then lower element is record
then lower elemnt is row
then FirstName
LastName
MiddleName
City
Place
State
Country
anyway i pasted my sxd dt_outbound type
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:praba_flatfile2xml07"
targetNamespace="urn:praba_flatfile2xml07">
<xsd:complexType name="dt_outbound">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
2bc3c190404611dc88a3000423c7753d
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="record">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
35982b703f7911dc871cd71bc0a8016d
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="row"
maxOccurs="unbounded">
<xsd:annotation>
<xsd:appinfo
source="http://sap.com/xi/TextID">
359f57603f7911dcca2ed71bc0a8016d
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name="FirstName" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
359f57613f7911dc8d9cd71bc0a8016d
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element
name="LastName" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
359f57623f7911dca6e8d71bc0a8016d
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element
name="MiddleName" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
359f57633f7911dcc31ed71bc0a8016d
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element
name="City" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
359f57643f7911dc8c7ad71bc0a8016d
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element
name="Place" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
359f57653f7911dca7dbd71bc0a8016d
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element
name="State" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
359f57663f7911dcbd52d71bc0a8016d
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element
name="Country" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
359f57673f7911dca78ad71bc0a8016d
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema> -
Merge text file with condition
I have two text files (report1.txt and report2.txt) that I want to merge with conditions:
- Matching rows that have same "ID" and same "TranVal", will keep only one instance
- Mismatching rows that have same "ID" both rows from 2 file, but column "TranVal" has different value, then the row from report2.txt will replace row in report1.txt
- Any "ID" that exists in one textfile but not the other one, will be copied to the final merged file
report1.txt:
TranDate,ID,TranVal,Comment
061211,9840,40,done
061211,9841,30,done
061211,9842,28,done
report2.txt:
TranDate,ID,TranVal,Comment
061211,9840,40,done
061211,9841,89,done
061211,9843,25,done
Final result should be:
merge.txt:
TranDate,ID,TranVal,Comment
061211,9840,40,done
061211,9841,89,done
061211,9842,28,done
061211,9843,25,doneHi,
I just checked Import-Csv option. I will be able to manage this problem if i can get it in CSV format and work with objects, BUT the problem is in my real file
the file-format is different which is not comma-separated, instead have "-" as seperator. To simplify the problem i used comma in my question.
TranDate,ID,TranVal,Comment
061211-9840-40-done
Could
you suggest me if there is any way to convert "-" separators to CSV? -
Hi,
I need an information if whether anything like this can be done in java or not !!
The requirement is to place the jave code statements into a text file and dynamically execute these statements which have been placed in the file. for eg: if a text file "test.txt" contains a statement
System.out.println("Hello world"); without the class being defined or the main method being defined. I need to execute this statement and print out hello world on the console.
is this possible ???
I would be using JDK 1.2 or 1.3 for this but certainly not 1.4.x and above
please do let me know if this problem can be tackled in anyway !!
Thanks in advance !I'd suggest first checking to see if the code in question would also be valid code in an interpreted language like Javascript, Groovy, or BeanShell.
If it is, then use an interpreter for the appropriate language, an interpreter written in Java and which you can plug into the Java program you're using.
Otherwise, I suppose you could wrap a class and method around the code, and compile and run that. -
Find certain areas of text from a text file
Hello all java Gurus! I need your help on something I am trying to do in order to learn java. I am very newbie and please show mercy if I don't understand every answer you probably give me. Here is my problem. I have text file with certain areas I need to "isolate" (to insert the data in a jTable after I solve this first).
Let's say we have the following data in a text file:
FILE IS "A.txt"
***first***
this is 1 line in first
this is 2 line in first
this is 3 line in first
***second***
this is 1 line in second
this is 2 line in second
this is 3 line in second
***third***
this is 1 line in third
this is 2 line in third
this is 3 line in third
**************I now need to read the "segment" that start with " *** blablabab *** " and ends with " ************** " and store the lines of this segment to another text file "B.txt".
So "B.txt" has let's say this "segment".
***second***
this is 1 line in second
this is 2 line in second
this is 3 line in second
**************How can I do this? I know how to read/write from/to a text file with FileReader and BufferReader but I have no idea how to experiment with this. Is there anyone who can give me a hint or a help to start?
I am very new to java so be gentle :-)
Thank you very much in advance.
KostasWell this is a very good and I think efficient way to
do but unfortunately I don't have a clue about regex
and how they work. This is something I should learn.
With the expression you wrote I would have each text
block at a time? This will be stored then to an
Arraylist like above? If you have another idea please
suggest. I am interested in learning new tricks :-)
Thanks for your reply notivago!!!
KostasRegular expressions have a somewhat steep learning curve but they are worthy the effort, they are fast and powerfull text finding tools, the whole idea is that you search the text for some pattern. I will provide you a sample code, it is half way to solve your problem, you will have to make some minor adjustements to use it you your real application(none in the RE itself I hope).
To understand it, look at the Pattern class documentation and the Matcher class documentation in the API.
* SectionExtractor.java
* version 1.0
* 25/05/2005
package samples;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
* @author notivago
public class SectionExtractor {
* @param args
public static void main(String[] args) {
String text =
"***first***\r\n" +
"this is 1 line in first\r\n" +
"this is 2 line in first\r\n" +
"this is 3 line in first\r\n" +
"**************\r\n" +
"***second***\r\n" +
"this is 1 line in second\r\n" +
"this is 2 line in second\r\n" +
"this is 3 line in second\r\n" +
"**************\r\n" +
"***third***\r\n" +
"this is 1 line in third\r\n" +
"this is 2 line in third\r\n" +
"this is 3 line in third\r\n" +
Pattern pattern = Pattern.compile( "\\*{3}(.+?)\\*{3}$(.*?)\\*{14}", Pattern.DOTALL | Pattern.MULTILINE);
Matcher matcher = pattern.matcher(text);
matcher.find();
System.out.println( "Header: " + matcher.group(1) );
System.out.println( "Text Body: \n" + matcher.group(2) );
}The sample as is, runs and give you output that should be clear on how the expression works. Try running it.
May the code be with you. -
Hi! I've got several archived text files - 040107.txt,
040207.txt, 040307.txt, for example - and I want to be able to
build a dynamic link which loads whichever file is selected into
the Flash movie. This list needs to be able to build itself as I
write new files every day and add the old ones to the archive. I'm
stumped. How can I do this?If you are using XML to load data, then use the CDATA to wrap
the html text.
If you are using LoadVars to load data, be sure you do not
have any & in the text content. If you do convert to hex.
Bottom line is you need to trace the text you load to see
what you are getting.
Flash should show HTML if you have the
TextField.htmll
property set to true which is also done in IDE with "Render Text as
HTML". But you must use the
TextField.htmlText
property to set the text.
Finally malformed HTML in Flash TextFields generally dies
like you describe.
You should be able to test the display of data in dynamic
TextFields with a simple Flash movie containing the TextField and
the text stored in a variable and then loaded into the htmlText
property. If it is not working there then you have to look at the
data.
Maybe you are looking for
-
Missing Option to Use Airplay on Apple TV on Ipad
I recently ugraded both my Ipad and Apple TV. After doing this, I no longer get the option on my Ipad to use apple TV. I live in Mexico so I access US TV now thru Google on the IPad and then move it to the Apple TV. This previously worked fine and
-
Serial Number error while posting UD
Hi all, I am getting an error message "Serial number xxxx not suitable for movement type". "Serial number xxxx cannot be used here" while making usage decision for an production material. The error is happening only for the particular GRN. The GRN wa
-
How do i make a cut-out of an image?
How do i make a cut-out of an image?
-
Recommended Airflow for R9 290X Gaming?
Hi. I'm kind of new to the gaming club and I've been struggling just trying to get the temps right; I've added a top fan, a side fan, a front fan, I've even replaced the thermal paste. Nothing seems to do the trick... So what should I do to improve t
-
How about this: When the user fills out a form and submits it, can the results be attached as a csv file to a notification? For example, they fill out the form which includes a 'forward to' email address, submit it, and the csv results are emailed to