Is there any command line interactive tool like meld?

1,573

Solution 1

How about Vimdiff?

http://www.thegeekstuff.com/2010/06/vimdiff-file-diff-tool/

It might not look as fancy as Meld, but it looks like a great option for visual diffing in terminal.

Solution 2

Sounds like the perfect use for a distributed version control system like either git or Mercurial.

A very good tutorial for Mercurial is available here:

http://hginit.com

Share:
1,573

Related videos on Youtube

Mike
Author by

Mike

Updated on September 18, 2022

Comments

  • Mike
    Mike over 1 year
    Names <- c("SUSAN,ALTOP","Brent,SPINER","KIM,YAMAGUCHI","John,McMurphy","Kevin,Y")
    City <- c("Toronto","New York","Chicago","Toronto","Tokyo")
    DF <- data.frame(Names,City)
    

    I'm hoping to create a function that will capitalize the first and last names in the simple example data frame above so that the names read as "Susan Altop","Brent Spiner"...etc. (Notice that I've also removed the commas.)

    I can accomplish this using the following codes, either separately or with piping. But I'm hoping to create a function since I'll have to do this many times, but I'm not sure how to do that when using dplyr, tidyr, etc. I'm also open to more creative suggestions that use lists and purrr, if possible.

    DF <- DF %>% separate(DF,Names,c("First","Last",sep=","),remove=TRUE)
    DF <- DF %>% mutate_each(funs(tolower),First,Last)
    DF <- DF %>% mutate_each(funs(Capitalize),First,Last)
    DF <- DF %>% mutate(NewNames=paste0(First," ",Last)
    
    • Takkat
      Takkat over 10 years
    • David Foerster
      David Foerster over 10 years
      Sounds like you want a revision control system (which are usually built on top of diff).
    • Hack-R
      Hack-R over 7 years
      I have a function I wrote to do this a long time ago, but it doesn't use any special packages. Do you want it? it works with McName, Arabic names, etc.
    • Gregor Thomas
      Gregor Thomas over 7 years
      If your problem is in writing a function, you should be clear about what your inputs and outputs are. You want to give it a data frame? Do you want to capitalize all columns? Does your function need to guess whether or not to separate by commas? Will you guarantee all columns are strings? Are there other arguments you want to give it?
    • alistaire
      alistaire over 7 years
      Not that I really recommend this approach, but: library(tidyr) ; library(dplyr) ; DF %>% separate(Names, c('First', 'Last')) %>% mutate_at(vars(-City), funs(paste0(substr(., 1, 1), tolower(substr(., 2, nchar(.)))))) %>% unite(Names, First, Last, sep = ' ') Pretty much any technique is going to kill the second "M" of "McMurphy", though.
  • David Foerster
    David Foerster over 10 years
    … or any revision control system for that matter.
  • Sunil Shahu
    Sunil Shahu over 10 years
    Thanks for suggestion. But i am already using git and wanted to merge two files with same name. I think vimdiff what i needed as @Tobberoth suggested.
  • MikeyE
    MikeyE over 5 years
    So much better than meld, no GTK lib issues!