LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   1. shell script "find and replace" on text 2. java GUI application (http://www.linuxquestions.org/questions/programming-9/1-shell-script-find-and-replace-on-text-2-java-gui-application-153696/)

randomx 03-05-2004 12:33 AM

1. shell script "find and replace" on text 2. java GUI application
 
distro: suse 9.0
kernel: 2.4.22

1. How do I implement a "find and replace" BASH shell script?

example....
#locate the file xfiles then find the word randomx inside xfiles.
locate xfiles | grep "randomx"

#replace randomx with this word.
???

#then delete the "Smoking Man" word/sentence.
??


2. Newbie Java programmer. Bear with me.

Can I use QT or Glade or Kdeveloper or any other RAD Visual application to write Java code? I want to draw objects like buttons then just add the java code associated with that object, instead of doing everything from scratch.

thanks
randomX

hiteshmaisheri 03-05-2004 01:28 AM

the answer to the first question is :
read the man page of sed to get more information... this would help you more... i don't have more information of it right now...

mfeat 03-05-2004 11:17 AM

here's an example of how I replace text in files located in one directory.

ls | while read fname; do
cat $fname | sed 's/randomx/newx/' > $fname.tmp
mv $fname.tmp $fname
done

randomx 03-05-2004 12:49 PM

got the find text and replace it part...
 
#replace the word "cancerman" for the word "mulder" in the file xfiles.

replace cancerman mulder -- xfiles

Cool. Got it. I found sed a little more complicated in syntax terms. That's my opinion anyway so don't take it too serious.

2. So...Is there any RAD visual application for Java? can I use QT or Kdeveloper?

thanks.
randomX

elitecodex 03-05-2004 01:01 PM

I haven't programed in Java in a while, but Borland has a RAD for Java (Called JBuilder). Im not sure if NetBeans has it... but it might. Check into those two.

I am also not sure which API they use either. Im sure you can choose between the two, but I dont know (I only use Swing anyway).

Hope this helps!



All times are GMT -5. The time now is 11:01 AM.