Is there any command line interactive tool like meld?
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:
Related videos on Youtube
Mike
Updated on September 18, 2022Comments
-
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 over 10 yearsalso see askubuntu.com/questions/12473/…
-
David Foerster over 10 yearsSounds like you want a revision control system (which are usually built on top of
diff
). -
Hack-R over 7 yearsI 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 over 7 yearsIf 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 over 7 yearsNot 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 over 10 years… or any revision control system for that matter.
-
Sunil Shahu over 10 yearsThanks 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 over 5 yearsSo much better than meld, no GTK lib issues!