Perforce Diff Excel Files with SSCL - excel

this is a continuation of the following stack overflow question: Perforce diff for excel files
I'd like to use the solution proposed by domalb, which is to use SSCL. I've downloaded the SSCL solution and am able to successfully diff excel files when using the cmd prompt. However, I'm having trouble getting the arguments to work correctly in Perforce.
In perforce, I go to Edit -> Preferences and select "Diff" from the left menu. I then "specify diff application by extension (overrides default). I set the extension to .xlsx, set the application to sscl.exe, and set the arguments to %1 %2 -d="C:\Program Files (x86)\Microsoft Office\Office16\DCF"
However, this does not work. When I turn on verbose logging in the argument list, I see the following error message:
How can I resolve this error when passing in the SSCL arguments? It looks like it cuts off the directory at the first space, so it is not respecting the double quotes? Thanks for your help!

Related

How do I get rid of errors in .bat file that aren't affecting outcome of the script?

I have an application calls the below command:
C:\Users\212340141>"C:\Program Files\Microsoft Office\Office14\excel.exe" /e "C:
\My Programs\CPU Analysis\data\IOParse.xlsm" "-iodumplocation"C:\My Programs\CPU
Analysis\iodump\065901_iodump.txt""
When I run this command, it opens excel, passing in the C:\My Programs\CPU Analysis\iodump\065901_iodump.txt path as a parameter for the excel book to use in the macros it runs automatically. The macros run correctly and the file is modified correctly, but I get the following errors when I run the command:
How can I get rid of the errors?
Answer
As mentioned in the accepted answer, excel was trying to open multiple files because of how I wrote the command. The way I solved this is I created a text file to hold the path I was trying to pass into the macro. The macro would open the text file and read the path to get the path it needed. This is much cleaner and easier than trying to get the path from the command line.
Description of the startup switches for Excel lists and describes the optional switches which can be used on starting Excel. /e is listed on this page written by Microsoft. But -iodumplocation is definitely not a command line switch for Excel.
Using double quotes within a double quoted string is always a mistake on command line and the result is unpredictable as depending on code of command line parser, see answer on Why double quotes should be always only at beginning and end of an argument string?
The command line used is obviously interpreted by Excel as
"C:\Program Files\Microsoft Office\Office14\excel.exe" /e "C:\My Programs\CPU Analysis\data\IOParse.xlsm" "-iodumplocation" C:\My Programs\CPU Analysis\iodump\065901_iodump.txt""
which results in
/e ... starting without displaying the startup screen and without the creation of a new workbook.
C:\My Programs\CPU Analysis\data\IOParse.xlsm ... opening this marco-enabled workbook file.
-iodumplocation ... the failed attempt to open a file with name -iodumplocation.xlsx in current working directory.
C:\My ... the failed attempt to open a file with name My.xlsx in root of drive C:.
Programs\CPU ... the failed attempt to open a file with name CPU.xlsx in subdirectory Programs of current working directory.
Analysis\iodump\065901_iodump.txt"" ... the failed attempt to open a file with invalid name 065901_iodump.txt"" in subdirectory Analysis\iodump of current working directory.
I can't suggest a correct command line as I don't know what -iodumplocation should be.

Setting an environment variable in the shortcut target

I'm writing a Inno Setup script where I need to create a shortcut that sets an environment variable in the shortcut target. The target string is something like:
cmd.exe /c set ENV_VAR=%CD% && "C:\Program Files\MyApp\MyApp.exe"
But for some reason I cannot fantom the shortcut is never created. I checked the length of the target string: 162 characters, which seems to be below the Windows (?) limit. If I create the shortcut with a target string without the "... &&" prefix and then add it by hand, it works as expected, however. Any help is appreciated.
If you want to set ENV_VAR using inno setup as %CD% and "C:\Program Files\MyApp\MyApp.exe"
you can use ; as like below
C:\Program Files;C:\Winnt;C:\Winnt\System32
this might help you
set ENV_VAR=%CD%;C:\Program Files\MyApp\MyApp.exe
I have used
set ENV_VAR=%PATH%;C:\program files
Checked after listing all,there I found
ENV_VAR=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Linux For Windows\bin;C:\Program Files (x86)\Universal Extractor;C:\Program Files (x86)\Universal Extractor\bin;C:\Program Files (x86)\Calibre2\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Subversion\bin;C:\Program Files (x86)\WinMerge;C:\Program Files
the above environment variable length is 390 characters , so I believe in your case no issue with length.

GVim as merge tool for TFS

I want to use GVim as a merge tool for TFS 2010.
I can't figure out the Arguments for GVim.
Specifically the argument %4, when I use it I get an empty buffer for it. if I don't use it I get an error message that I must use it.
This may not be exactly to your liking, but here's how I use GVim for a merge tool.
I set it up to do a two-way merge: it has the 'source' on the left (where I'm merging from), and the merge file on the right (starts off as what my destination branch has for information).
I set it up like this:
command: C:\Program Files (x86)\Vim\vim73\gvim.exe
argument: -c "vert diffsplit %1 " %4 -c "wincmd l|0read %2 |diff"
What this does is as follows:
Reads in the 'source' file on the left, and splits the window (-c "vert diffsplit %1")
Opens up on the right side the merge result (%4)
Runs a quick script which:
Moves over the right window (wincmd l)
Reads in my existing changes in the branch (0read %2)
Re-runs the diff algorithm (diff)
This lets me "diff" my work against the incoming merge, and saving the right hand side will resolve the merge.
Your screenshot suggests you are using Vim 7.3 . According to Vim site:
http://vim.wikia.com/wiki/Running_diff
At some point, the MyDiff function provided by the "Vim without Cream"
installer has been modified. As of Vim 7.3.138 it is still broken.
However, You can try the following verbose-mode parameters
command : gvim
argument: -V -od %1 %2

"Unable to open image" error when using ImageMagick's Filename References

I'm using ImageMagick to do some image processing from the commandline, and would like to operate on a list of files as specified in foo.txt. From the instructions here: http://www.imagemagick.org/script/command-line-processing.php I see that I can use Filename References from a file prefixed with #. When I run something like:
montage #foo.txt output.jpg
everything works as expected, as long as foo.txt is in the current directory. However, when I try to access bar.txt in a different directory by running:
montage /some_directory/#bar.txt
output2.jpg
I get:
montage: unable to open image
/some_directory/#bar.txt: No such file
or directory # blob.c/OpenBlob/2480.
I believe the issue is my syntax, but I'm not sure what to change it to. Any help would be appreciated.
Quite an old entry but it seems relatively obvious that you need to put the # before the full path:
montage #/some_directory/bar.txt output2.jpg
As of ImageMagick 6.5.4-7 2014-02-10, paths are not supported with # syntax. The # file must be in the current directory and identified by name only.
I haven't tried directing IM to pull the list of files from a file, but I do specify multiple files on the command line like this:
gm -sOutputFile=dest.ext -f file1.ppm file2.ppm file3.ppm
Can you pull the contents of that file into a variable, and then let the shell expand that variable?

Vim problem with gf command

I am using Vim and I have set the path (set path+= c:/work/etc/etc) to my project directory (for C#), but still using command 'gf' give me error:
E:447 Can't find file.
Is there anything I am doing wrong over here?
G'day,
To get a bit more detail on your current path settings you can see what's being included and the files vim can't find by entering the command:
:checkpath
and you'll get a dump of the files not found, e.g.
--- Included files not found in path ---
<io.h>
vim.h -->
<functions.h>
<clib/exec_protos.h>
Or you can get a listing of all included files, both found and not found, by entering
:checkpath!
Enter
:help path
to get more info on the path syntax.
Edit: Don't forget that using the syntax
set path=/work
will completely reset your path variable to what you've just declared. I'd suggest using
set path+=/work
instead. This won't clobber the current path and will just add your /work directory instead.
HTH
I also found out that
:set path+=./foo/bar
adds a search location relative to the directory of the current file, just like '.' does.
My vim didn't want to search for such include
#include <common/util/string.h>
So what I needed to do was
:set path+=foo/bar
instead of
:set path+=./foo/bar
The former adds a search path relative to current working directory. Hopefully it helps someone.
First can you open the file using :find file.name ? (:help find for more info). If this does not work then your path is wrong. If :find does locate your file then do the following:
Insure that you are not in Visual/Insert mode
Place cursor on the first letter of the filename and press gf
I know this is an old question, but I also had some troubles with this for another reason and it took me some time to find out why. I hope this might be helpful to someone.
When a directory is matched with wildignore, gf does not work for files in it, nor does :find.
This is obvious if you read wildignore's documentation, but I forgot I ever changed this variable, and what it was for exactly. Also I used a glob, and it was not immediately apparent to me that the directory I was using gf in, was also matched with this glob.
Make sure there is no leading character to the file name if you press gf, i.e. using gf when the cursor is on help.txt will not work here:
file=help.txt
If you are talking about the gf tool wri††en by tomnomnom then here's how to set-up:
Setting PATH for GO (if you have not setup yet).
export GOROOT=$HOME/go
export PATH=$PATH:$GOROOT/bin
Step 1: Download tool from github
Step 2: cp -r path/to/tomnomnom/gf/examples ~/.gf
Step 3: source ~/tools/gf/gf-completion.bash
Now gf should work along with auto-completion from anywhere.
Source: Original sources are present at his repo.

Resources