Reading .evtx files in JAVA - java

I'm trying to find the best way to read .evtx files in JAVA the only almost valid solution I found is parsing it to a csv file using windows power shell (takes about a minute to parse a file with 250 lines) and then reading the csv file with missing data.
is there any better options for reading evtx files in JAVA?
Thanks.

You may want to check an open source library here.
It parses evt files (old version of Windows event log), not sure if it will tackle evtx files.

Related

Reading file on remote server via Java

I am developing a Java application through which I need to read the log files present on a server and perform operations depending on the content of the logs.
Files range from 3GB up to 9GB.
Here on stack I have already read the discussion about reading large files with java, I am attaching the link:
Java reading large file discussion
In the discussion, the files are read locally,
in my case i have to retrieve and read the file on the server, is there an efficient way to achieve this?
I would like to avoid having to download files given their size.
I had thought about using URL Reader to retrieve the files, but I have doubts about the speed of execution.
The files I need to recover are under the path C:\production\LOG\file.log
Do you have any suggestions or advice?

Generate SPSS File using PL/SQL

Problem:
I am looking for a way to generate a SPSS file using PL/ SQL. Currently, I am able to generate a .csv file with roughly 300-400 columns. I have tried to google and didn't have any luck in finding a way to generate SPSS file using PL/SQL.
Expected Solution:
Either generate a SPSS file directly OR use some kind of java class like one this program SPSS Writer uses to convert the .csv file into SPSS. My understanding is that we would need to provide the metadata file in order to convert the csv file into SPSS.
Any suggestions would be much appreciated.
If you are trying to generate a sav file without SPSS you can write a program using the SPSS io modules available free via the SPSS community website.

How to read excel file with Java without external jars

I'm trying to read excel file and pass all the data to DB. I found a few code examples but all of them required external jars. How can I read excel files using only the standard library?
IF you don't want to use a library then you will have to download the Excel file format specs from MS and write an Excel parser yourself (which is extremely complicated and takes > 10 years for one developer). For the OpenXML format spec see here and here.
Thus I really recommend using a library for that...
Try Apache POI - a free Java library for dealing with MS Office documents..
You can save as the excel file *.cvs and sperated ";". Then, you can read file line by line and get the columns which is getting from each token.
Microsoft excel uses a binary way to save its data, so manually reading excel files might be a hassle. If you could convert the excel (xls) to a comma seperated values (csv) file, then you can just read the file and split your input on the comma's.
This is a difficult problem. First off, it is not as simple as "adding a third party library". There are no existing EXCEL reading libraries that do not cost money and the one that I know that does work is very expensive AND has bugs in it.
One strategy is to create an Excel add in that reads the data and transfers it to your application by OLE or the clipboard or by a TCP/IP port or saves it to a temporary file. If you look in the source code for OPeNDAP.org's ODC project you can find an Excel add in and TCP capability to do this.
You can try referring to the reader in OpenOffice which is open source code, however, in my opinion that code is not easily refactorable into a private project for various reasons.
Microsoft has components and tools to open Excel files and expose them via COM objects.
You can also learn the BIFF format and write your own parser. You probably would want to write a parser for BIFF5, but be forewarned, this is a BIG project, even if you only parse a limited number of data types.

How to compress text file to rar format using java program

Is there any java library by which we can compress a plain text file(.txt) into winRAR format(.rar). I have been searching in google but couldn't find any relevant library which does that.
you can always do
Runtime.getRuntime().exec("rar -a somefile.txt");
I think RAR is not open-source format. I'd rather use ZIP - it's built-in in Java.
RAR is a proprietary format, and I don't know of any library to create it (although there seem to be some that can read it). Any reason why you wouldn't use another, more open format like 7zip (for compression), or plain Zip (for universal compatibility)?
(From the question, of which this one is a duplicate - RAR archives with java)
You could try JUnRar, "a RAR handling API implemented in pure Java" (quoting the site).
No you can not do it. Only WinRAR can create rar file. There is only a unrar library for it.
One reason to use RAR: It is sooooo much better than ZIP. For example: One of our production print files has a lot of repetition (including images) in it. 142 MB large, it zips to about 80MB. RAR seems to detect these repetitions and the resulting file is not even 2MB!
Why RAR? as others have mentioned, RAR is not open.
Java has native ZIP API.
Java Zip API: How to Create a Zip File Using Java

Using zip file without extracting in java

I'm facing a problem that, we have a .zip file that contains some text files. Now I'm using java to access that files. If it is not in the .zip file I can read and print on my console easily using FileInputStream.
But how to read a file from .zip file? I use J2SE only..
You should try a ZipInputStream. The interface is a little obtuse, but you can use getNextEntry() to iterate through the items in the .zip file.
As a side note, the Java class-loader does exactly this to load classes from .jar files without extracting them first.
Everything you need is in ZipFile: https://docs.oracle.com/javase/7/docs/api/java/util/zip/ZipFile.html. Google for examples on the web, and if you have specific problems then come back to SO for help.
(The link will eventually break; when it does simply websearch java zipfile.)

Categories

Resources