04-10-2016 12:22 PM - edited 04-10-2016 12:33 PM
I have a so many and big text files .txt.
I want to compare them quickly by using sas and unix commands.
I want to compare the R1 and R2 files one by one R1/ab.txt with R2/ab.txt
Thank you for your answer
04-10-2016 12:34 PM
Your question as it stands is vague.
1. What do you have to start off with?
2. Which part of this are you having difficulty with?
3. What do you want your output to look like?
04-10-2016 12:55 PM
So, if i was not clear
I have a folders :R/R1 and R/R2
In R1 and R2, I have a text files : a.ext, b.txt, .... in R1 and R2
Every file in R1, I will be in R2, I want to compare R1/a.txt with R2/a.txt
In the output, I want to get the name of the files with a diff and the difference lines in new file : R/dif/a_dif
04-10-2016 01:16 PM - edited 04-10-2016 02:35 PM
1. Create a listing of files from directory R1- this is relatively straightforward in a unix environment. (ls filepath or see previous posts)
2. If you're sure that you have the same in each folder you don't need to list the folders
3. Build your compare command
4. Execute compare command and store into a file or dataset
What have tried so far?
04-11-2016 02:16 AM
The UNIX command for comparing text files is diff. If files A and B are identical, diff A B will produce no output and return with exit code 0; differences will produce output and exit code 1, all other exit codes signal an error like file not found.