LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-29-2015, 08:55 AM   #1
daor79
LQ Newbie
 
Registered: Nov 2009
Posts: 9

Rep: Reputation: 0
Java code for sorting 3 column excel


Anyone can share me code or solution sorting 3 cols in excels by Java. PM nha khoa



Thank in advance

Last edited by daor79; 10-29-2015 at 06:32 PM.
 
Old 10-29-2015, 09:04 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,642
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
Ordinarily this is simply done by a macro within the Excel environment. When you say, "by Java," you need to carefully describe your use-case.
 
Old 10-29-2015, 10:27 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,005

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
I agree with sundialsvcs, this is pretty standard for Excel, why in the world would you need to use java??
 
Old 10-29-2015, 12:28 PM   #4
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Red Hat, CentOS
Posts: 773
Blog Entries: 3

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Quote:
Originally Posted by grail View Post
why in the world would you need to use java??
That's what I always say to those who use Java!!!

Sorry, it just had to get out. All in good fun people, all in good fun.
 
1 members found this post helpful.
Old 10-29-2015, 05:16 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,642
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
(Chuckle ...) Well said, HMW.

Nevertheless, in this case, the real question is: "What is Java doing here?" For that matter, "What is Linux doing here?"

Microsoft Excel is (koff, koff ...) "the flagship of their fleet," and (yes, I am complimenting Microsoft ...) still "one helluva product." Normally, people ... do things ... (heh, whether they should be attempting these things or not!) ... using Visual Basic macros. Or, they are using the OLE interface. (Which, after "never-mind how many" releases ... allright, allright, it was complicated ... Microsoft actually did get "very right.")

So, what exactly does this have to do with Java and with Linux? To me, it sounds like "you're barkin' up the wrong tree and holdin' the wrong gun!"
 
Old 10-29-2015, 06:31 PM   #6
daor79
LQ Newbie
 
Registered: Nov 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Hi Guys,

I mean how create java algorithm can do as macro
 
Old 10-29-2015, 06:36 PM   #7
daor79
LQ Newbie
 
Registered: Nov 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Let me clarify
Our app: get large data from many location SQL, XML...and storage to Excel.
We want sorting all data by multi cols and comparing together.
Can't use macro...
With .NET or Vb is very easy , using sorting
Set objRange = objExcel.ActiveCell.EntireRow
objRange.Sort objRange, xlAscending, , , , , , xlNo, , , xlSortRows
set objExcel=nothing

But java...?
 
Old 10-29-2015, 11:48 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,355

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
I have to admit I don't know MS Desktop products like Excel, but I am under the impression that its supposed to be pretty good at what you are asking.
If you want to process externally, usual approach is to export as csv and then use whatever language you want (I've done it in Perl), creating new o/p also as csv, then re-import.
I don't know if you can call Java directly from Excel (or vice versa...)
 
Old 10-30-2015, 12:16 AM   #9
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Posts: 952

Rep: Reputation: 217Reputation: 217Reputation: 217
Before (dot)net, m$ used to push visual basic, visual c++, visual j++, visual inter dev all usually bundled together as visual studio though people mostly used only visual basic.

I expect that the if you get hold of the manual/cd you could get the solution.

The set commands will be similar to vb but with java syntax.

OK

Last edited by AnanthaP; 10-30-2015 at 12:21 AM.
 
Old 10-30-2015, 09:39 AM   #10
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,005

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Quote:
Originally Posted by daor79 View Post
Let me clarify
Our app: get large data from many location SQL, XML...and storage to Excel.
We want sorting all data by multi cols and comparing together.
Can't use macro...
With .NET or Vb is very easy , using sorting
Set objRange = objExcel.ActiveCell.EntireRow
objRange.Sort objRange, xlAscending, , , , , , xlNo, , , xlSortRows
set objExcel=nothing

But java...?
Not sure about anyone else, but I am not sure how the above clarified anything??

If .NET or VB is so easy, again, why is java in this mix???
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Text file to Excel adding column arjun_b Linux - Newbie 3 01-05-2012 07:53 AM
[SOLVED] sorting a first non-numerical column in a file sasanthi Linux - Newbie 8 07-13-2011 06:39 AM
sorting a file by column AutoC Programming 6 08-07-2009 05:43 PM
What software for sorting/grouping data from Excel SML Linux - Software 3 05-21-2007 07:43 AM
Sorting of multi-column output rytrom Linux - Newbie 11 09-15-2003 11:31 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration