Comparing files using gEdit
Monday, 16. June 2008, 13:23:12
At the moment i'm heavily on scripting various things and some times its needed to compare files. As a Winy i used PSPad which have an included comparsion tool. Now i'm on Linux using gEdit and i'd like to have such a nice workflow once i had using PSPad.
I found a very nice way using Meld. Meld is a graphical comparsion tool and will work very well as an external tool of gEdit:
1) Install the package "meld"
2) Start gEdit and opening the Menu "Tools > External Tools..."
3) Add a new external tool:
* Name: Compare Files
* Description: Compare then opened file with another
* Command:
4) Now you have in "Tools" an menu entry "Compare Files" that will use the active document of gEdit and the other browsed file for comparsion
Happy computing
I found a very nice way using Meld. Meld is a graphical comparsion tool and will work very well as an external tool of gEdit:
1) Install the package "meld"
2) Start gEdit and opening the Menu "Tools > External Tools..."
3) Add a new external tool:
* Name: Compare Files
* Description: Compare then opened file with another
* Command:
#!/bin/sh meld $GEDIT_CURRENT_DOCUMENT_DIR/$GEDIT_CURRENT_DOCUMENT_NAME `zenity --file-selection --title=File for comparsion --filename=/home/` &* Any othe roption is not interesting so press close
4) Now you have in "Tools" an menu entry "Compare Files" that will use the active document of gEdit and the other browsed file for comparsion
Happy computing


Hello,
I have meld installed.
I have an error :
/bin/sh: Can't open meld $GEDIT_CURRENT_DOCUMENT_DIR/$GEDIT_CURRENT_DOCUMENT_NAME `zenity --file-selection --title=Datei zum vergleichen
Exited: 512
Strange ?
By anonymous user, # 16. June 2008, 14:23:30
#!/bin/sh
meld $GEDIT_CURRENT_DOCUMENT_DIR/$GEDIT_CURRENT_DOCUMENT_NAME `zenity --file-selection --title=Datei zum vergleichen auswählen --filename=/home/` &
?
What happens when you try to start meld /path/to/file.txt /path/to/another/file.txt at the shell?
By area42, # 16. June 2008, 18:54:14
Sorry, i have put all on the same line :
#!/bin/sh meld $GEDIT_CURRENT_...
I'm under ubuntu hardy 64.
Zenity is installed (under gnome).
When i try to start meld @ the shell, all is working fine...
I have two css files opened in gedit and when i run the script, meld opens with an error > invalid arguments received > 4
By anonymous user, # 16. June 2008, 20:11:22
at the first tries i get the same errors. Make sure that there are spaces just after meld, after $GEDIT_CURRENT_DOCUMENT_NAME and after ... home/`. Any space between will accept Meld as the next file.
By area42, # 17. June 2008, 07:55:12
It does not work.
But I will try to correct the problem.
For now, I especially look forward to seeing to see CSSdev
Thank you very much for your great job
By anonymous user, # 18. June 2008, 11:57:12
Right script to take care of filepath spaces:
#!/bin/sh
meld "$GEDIT_CURRENT_DOCUMENT_DIR/$GEDIT_CURRENT_DOCUMENT_NAME" "`zenity --file-selection --title=File for comparsion --filename=/home/`" &
By anonymous user, # 31. July 2008, 14:02:07
"" <- is a good idea
By area42, # 31. July 2008, 15:25:18