Wednesday, June 22, 2016

Bypass excel csv formula conversion on fields starting with + or -

When you create a csv file with some entry start character is minus(-) or plus(+)  it will not open correctly in Microsoft EXCEL.

I have found few solutions for that and you can try out any format which will suits for you.

I java coding I tried "StringEscapeUtils.escapeCsv(String args)"  method which comes with apache "commons-lang.jar" and it did not resolve that.

Some how I found the correct manipulation


The csv entry I have is
------------------------------------------------------------------------
1,ERROR,- no file(s) to resolve.,null
------------------------------------------------------------------------

This will not show correctly. most of the time excel cell will look like "#NAME?"

to get the correct excel file conversion from csv, we can do following

1. add space before minus(-)
2. add space before minus and put the whole line within quotes
3. add equal sign(=) before also

so solution will looks like

----------------------------------------------------------------------------
1,ERROR, - no file(s) to resolve.,null
1,ERROR," - no file(s) to resolve.",null
1,ERROR,=" - no file(s) to resolve.",null

----------------------------------------------------------------------------


you can do same with plus sign(+)

Tuesday, June 21, 2016

Perfoce resolve after merge

Perforce is a nice tool. We do lots of merges and it's really handy to know few commands when you resolve. Otherwise opening each and every file in the tool and accept merge is a hassle. If you anyway , takes accept merge when there are no conflicts, then best way to resolve using a command as whole change list


below is the way to run command.
eg: you may need to resolve chnagelist 210153

>p4 resolve -am -c 210153


this will produce an output for each file inside the change list as below.

========================================================

d:\Test.java - merging //Source_Code/Test.java#2
Diff chunks: 13 yours + 2 theirs + 3 both + 0 conflicting
//Test1.java - merge from //Source_Code/Test1.java
d:\Sample.java - merging //Source_Code/Sample.java#46
Diff chunks: 30 yours + 0 theirs + 1 both + 0 conflicting
//ServerError.properties - ignored //Source_Code/ServerError.properties
================================================

* if you resolve single file

>p4 resolve -am "d:\work\.classpath"

====================== output may look like below================
d:\work\.classpath - merging //Source_Code/.classpath#2
Diff chunks: 1 yours + 1 theirs + 0 both + 0 conflicting
//WORKSPACE/work/.classpath - merge from //Source_Code/.classpath