Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp

Lia Tas

Greenhorn
+ Follow
since May 10, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
1
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Lia Tas

Yes I want to output all the rows from the file and the headers. But now just the rows are printed without header

while(line=be.readline() !=null)...
6 days ago
Hi

I implemented a program which stores all the lines of an CSV file in a hashlist. But it is beginning at the first row of the csv file. I use the Bufferreader to read the lines and store them in a array list . But how can I also take the headers of the csv file? Should I implement that in the buffer reader as well? And how?

Thank you all.
6 days ago
I am not really sure what you mean .

I implemented a code which stores the content of each CSV files in a array list.. But is that a good solution ? My college told me something about hashmaps?! Is that a better solution to store the content of a csv file ?? And how can I print the line (based on the primary key of the table) which is different in both files..

Thank you.
2 weeks ago
I am not really sure how to do that
2 weeks ago
I want to code that in eclipse. Noting with Linux .. have to CSV files on my desktop and want to implement that .. Should I use Apache Poi have want to use it for the Java version 1.5
2 weeks ago
hi
i'm trying to compare the content of two csv files. I have the csv file test1.csv and test2.csv. The content from both should be the same.. if not , then I want to transfer the difference into a .txt file. If every thing is equal, everything is correct.

I just created two test csv files with columns and rows with content

The first column is a primary key of the respective table. I want to compare it by the identificator

test1.csv
1,Max,New York
2,David,Jersey
test2.csv
1,Max,California
2,David,Jersey
The Output here in the .txt should be the row "1,Max,New York"

I just have no code. And I am happy about every adivce and hint I can get. Thank you in advance.
2 weeks ago
Ohhhh you're right I will try that later and will reply !! Thank you .
1 month ago
Yes for all the three

String[] cmd = {"sh test.sh", "user", "pw"};
String[] cmd = {"/c/users/lia/desktop/sh test.sh", "user", "pw"};
String[] cmd = {"/c/users/lia/desktop/test.sh", "user", "pw"};

it is not working
1 month ago
So when I execute this in git bash and it is directly here " ~/Desktop " .
When I do a "sh test.sh" at this position I get the content and it works fine..

In my String I have it like this String[] cmd = {"sh test.sh", "user", "pw"};

When I do it like this : String [] cmd = {/c/users/lia/desktop/test.sh"..} it also does not work
1 month ago
Hi @Dave Tolls

on my desktop xD
1 month ago
Hi again :-)

It works !! But, when execute the shell script for its own on a linux server it works. But when I do export it as a jar file, it gives me an error.. does somebody know why?

"java -jar Test.jar" in Git Bash on Windows (Cannot run program "test.sh".. cannot find file..)

but when I execute it in Git Bash without the jar file, it works fine.. I am confused
1 month ago
Hi

I want to add paramters to the ProcessBuilder. I have a shell script like this

echo "hello"
read user
read pw

I want to call this script "test.sh" with the Process Builder and want to give the user and the pw as arguments. That the script is automatically doing this. Otherwise I always have to type in the user and the password..
The username and the pw is always the same, thats the reason why I want to do this automatically.

Thank you all.
1 month ago
So I have a script like this:

test.sh
echo "hello login"
read user
read pw

And the Java code above ^^ when I execute this script nothing happens it's like frozen
1 month ago
@Dave Tolls

So I have a shell script. If I want to execute this in command line not with a jar file or something like that I have to enter a password and a username.

This action I want to do with a jar file automatically... So I have to give the password and username to the process builder as arguments ? So I tried it but it does not work.. the password is test "user" is also "utest".. so executing the shell script is working but commit the password and username for executing it automatically via the jar file is still not working ☹️
1 month ago
I tried to give it as arguments through the process builder but this is still not working .. so the shell script is not executing because of the password and username ...
1 month ago