You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a for loop to new text files with old text files. And my for loop saves each diffr output as an html file. There are over 500 corresponding files that I am checking for differences between the old and new versions... I am hoping that none of the files contain differences. Is there anything I could add to my for-loop to avoid creating html files for files that have no differences?
You may want to check out https://github.com/brodieG/diffobj
If you are on *nix system:
sd = system(
sprintf("diff %s %s", file_a, file_b),
intern = TRUE)
if (length(sd) > 0) {
diff <- diffr(file1= file_a, file2 = file_b)
fi <- paste0(num,'.html')
saveWidget(diff, file=fi)
}
John
On Tue, Sep 19, 2017 at 4:05 PM, Dave Rosenman ***@***.***> wrote:
I created a for loop to new text files with old text files. And my for
loop saves each diffr output as an html file. There are over 500
corresponding files that I am checking for differences between the old and
new versions... I am hoping that none of the files contain differences. Is
there anything I could add to my for-loop to avoid creating html files for
files that have no differences?
(
for(num in filelist) { file_a <- paste0('new_files/',num,'.txt') file_b
<- paste0('old_files/',num,'.txt') diff <- diffr(file1= file_a, file2 =
file_b) fi <- paste0(num,'.html') saveWidget(diff, file=fi) }
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABBnriArDqdsF619rFjQWyGAWdMohn0nks5skB6jgaJpZM4Pc8OY>
.
I created a for loop to new text files with old text files. And my for loop saves each diffr output as an html file. There are over 500 corresponding files that I am checking for differences between the old and new versions... I am hoping that none of the files contain differences. Is there anything I could add to my for-loop to avoid creating html files for files that have no differences?
The text was updated successfully, but these errors were encountered: