my goal is to run text-report on all the files from folder A and B and get as an output html-file with all of the differences between corresponding files. The best would be, if it was just one output file. Is there a way to do it without calling text-report iteratively?
My current script looks like this:
log normal log.txt
text-report layout:side-by-side options:ignore-unimportant,display-mismatches
& output-to:"%3" output-options:html-color "%1" "%2"
I could use folder-report with links to the output of file comparison, but this does not support text-report options which I am after i.e. ignore-unimportant,display-mismatches. At least as far as I know, but I am new to this tool.
I will be very happy about any answer. If it is really not possible I will try to do it differently.
Beyond Compare's text-report scripting command operates on a pair of named files or on selected files. Use the latter method (selected files) to generate a single report for all files in a pair of folders.
log normal log.txt
load c:\folder1 c:\folder2
expand all
select all.files
text-report layout:side-by-side options:ignore-unimportant,display-mismatches
& output-to:c:\out.html output-options:html-color
To limit the report to files with differences, modify the select command and add a criteria command.
log normal log.txt
criteria rules-based ignore-unimportant
load c:\folder1 c:\folder2
expand all
select diff.files orphan.files
text-report layout:side-by-side options:ignore-unimportant,display-mismatches
& output-to:c:\out.html output-options:html-color
Related
long time reader, first time poster. Trying to automate a process to take many .PDF floorplan files and combine them into a single .PDF floorplan which will be referenced by a website.
To cut down on manual cut-and-paste from network shares to a web server as is current practice, I've written a PowerShell command as follows:
$SourcePath = '\\network\share\location\CAD Miniatures'
$DestinationPath = 'C:\inetpub\wwwroot\floorplans'
$LogFile = 'C:\Floorplan Transfer Logs\TransferLog.txt'
Robocopy $SourcePath $DestinationPath *.pdf /E /MIR /ZB /DCOPY:DAT /R:5 /W:10 /LOG+:$LogFile
My plan is to have this script run every hour as a Scheduled Task to mirror our local files and web files to ensure they remain up-to-date automatically.
The curve ball is the files being copied are individual files, within directories. I would like to take all .pdf files in a given folder and combine it into a single .pdf.
File structure is as such:
/floorplans
/ABC
/ABC-01.pdf
/ABC-02.pdf
/ABC-03.pdf
/XYZ
/XYZ-01.pdf
/XYZ-02.pdf
/XYZ-03.pdf
/XYZ-04.pdf
/XYZ-05.pdf
/XYZ-06.pdf
Within each directory (or in a subdirectory), I would like to have the combined output file be simple abc.pdf and xyx.pdf as per the examples above.
The file naming always follows the same format, but the number of files varies from a single file to over a dozen.
I would like to run the Robocopy and PDFtk tasks in the same script if possible (the idea to update all files, and combine them together). There would also be no need to merge files in which no updates have been detected.
I have multiple files in a folder and essentially want all of them to be compared with 1 main file. How do I go on about in doing this as it's only limited to two files opened at once?
Thanks.
Beyond Compare is limited to 2-way comparison. If the main file and the other files are all located in the same folder, load the folder in the Folder Compare. Then select the main file and one of the other files. Right click and select Open to launch the two files in the Text Compare. Repeat for each file that must be compared to main.
Beyond Compare also includes support for command-line scripting you can use to automate the comparison.
Example script to compare main to 3 files and output comparison results as HTML:
text-report layout:side-by-side options:ignore-unimportant,display-mismatches output-to:out1.html output-options:html-color c:\main.txt c:\1.txt
text-report layout:side-by-side options:ignore-unimportant,display-mismatches output-to:out2.html output-options:html-color c:\main.txt c:\2.txt
text-report layout:side-by-side options:ignore-unimportant,display-mismatches output-to:out3.html output-options:html-color c:\main.txt c:\3.txt
To run the script, use the command line:
bcompare.exe #c:\script.txt
The # character makes Beyond Compare run a file as a script instead of loading it for interactive comparison.
Beyond Compare Scripting Resources:
Help File > Scripts
Help File > Scripting Reference
Scripting Forum
I am using Beyond Compare 4 to compare 2 text files. I run BCompare.exe in the Windows command line and run this script:
# Script.txt
select right.diff
text-report layout:side-by-side options:display-mismatches output-to:"%3" "%1" "%2"
My layout option is side-by-side, but I do not actually want this. I want the output report to show ONLY differences from the RIGHT SIDE.This is what I was attempting to do in the first line select right.diff, but from what I know, that command is used for folder comparisons, not text.
Does anyone know how to accomplish this?
Note:
The %1, %2, %3 refers to the file locations of the arguements I pass into the command line. %3 is my output file, %1 is left input file and %2 is right input file.
Beyond Compare doesn't provide a method to output only one side in a report. A report layout that only outputs one side is on the feature wish list for a future version, but it doesn't have a scheduled release date.
I am trying to setup CTest to run a coverage analysis. It seems like I have to make a MyScript.cmake file and call it with ctest -S MyScript.cmake. I thought a simple example might look like this:
ctest_start(TestCoverage)
ctest_coverage(BUILD ${CTEST_BINARY_DIRECTORY})
but I am getting
ctest_start source directory not specified. Specify source directory as an argument or set CTEST_SOURCE_DIRECTORY
I don't want to hard code this path in the script file as I may want to run it in different places, so where am I supposed to get paths for CTEST_SOURCE_DIRECTORY and CTEST_BINARY_DIRECTORY?
I'm in the process of writing a bash script (just learning it) which needs to find files in subdirectories created after a certain date. I have a folder /images/ with jpegs in various subfolders - I want to find all jpegs uploaded to that directory (or any subdirectories) after a certain date. I know about the -mtime flag, but my "last import" date is stored in %Y-%m-%d format and it'd be nice to use that if possible?
Also, each file/pathname will then be used to generate a MySQL SELECT query. I know find generally outputs the filenames found, line-by-line. But if find isn't actually the command that I should be using, it'd be nice to have a similar output format I could use to generate the SELECT query (WHERE image.file_name IN (...))
Try below script:
DATE=<<date>>
SEARCH_PATH=/images/
DATE=`echo $DATE|sed 's/-//g'`
DATE=$DATE"0000"
FILE=~/timecheck_${RANDOM}_$(date +"%Y%m%d%H%M")
touch -t $DATE $FILE
find $SEARCH_PATH -newer $FILE 2>/dev/null|awk 'BEGIN{f=0}{if(f==1)printf("\"%s\", ",l);l=$0;f=1}END{printf("\"%s\"",l)}'
rm -f $FILE
You can convert your date into the "last X days" format that find -mtime expects.
find is the correct command for this task. Send its output somewhere, then parse the file into the query.
Beware of SQL injection attacks if the files were uploaded by users. Beware of special-character quoting even if they weren't.