Is there a Java text processor similar to Unix utilities?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Thanks_forHelp
Posted On:   Sunday, February 18, 2007 05:15 PM

In Unix, I can do this:


			
grep "abc" filename | cut-f1,2 -d, | sed "s/abc/xyz/g" |sort -u




Is there any Java class library out there that will accomplish the same, e.g.

			

TextProcessor tp = new TextProcessor("filename");

TextProcessor tp_a = tp.grep("abc").cut("-f1,2 -d|").sed("s/abc/xyz/g").sort("-u")




Thanks for your help

Re: Is there a Java text processor similar to Unix utilities?

Posted By:   Robert_Lybarger  
Posted On:   Sunday, February 18, 2007 07:59 PM

You can install Cygwin GNU utilities and have the same "UNIX" utilities directly. Mind you, there are subtle differences between the ways a UNIX shell handles a command line and the ways windows "cmd.exe" handles a command line -- quotes, slashes, etc. (But you'll have this headache regardless of what language the utilities are written in.)
About | Sitemap | Contact