I'm sure there's a better way to do this, and hence why I'm posting.
If you had two files and wanted to know what the unique data was between them, FC was an easy way achieve this, but the data had to be formatted quite well and sorted.
Let's use the following files as examples:
file1:
Code: Select all
-------------------------------------
SKU REPORT
Description Total
5hrEnergyBry #00719410500016
1 @ 2.99 2.99
A Animal Crk #00079783459343
2 @ 1.59 3.18
AirheadMyst #00073390002213
2 @ 0.29 0.58
AmerSp Blue #00047995855086
1 @ 5.65 5.65
Aquafina16oz #00012000001086
11 @ 1.09 11.99
Aquafina20oz #00012000001598
2 @ 1.39 2.78
B&M Wood Tip #00070137105251
1 @ 0.99 0.99
Baby Ruth #00028000010775
1 @ 1.19 1.19
BF Cups #00028000003555
3 @ 1.19 3.57
BicLighter #00070330600065
1 @ 1.39 1.39
Big Red King #00022000006684
1 @ 1.19 1.19
Butterfinger #00028000202033
2 @ 1.19 2.38
CaliTrailMix #00077449497548
1 @ 2.59 2.59
Candy Corn #00028348001619
1 @ 0.59 0.59
Cheez-It #00024100122615
2 @ 0.59 1.18
Coke 20ozVan #00049000031171
2 @ 1.69 3.38
Coke Can #00049000006346
3 @ 0.79 2.37
Dasani20oz #00049000009774
3 @ 1.39 4.17
DblMint King #00022000006660
1 @ 1.19 1.19
DP H2O 16oz #00082657500638
2 @ 0.89 1.78
Dt.Dr.P 20oz #00078000083408
1 @ 1.69 1.69
DtCoke 20oz #00049000000450
1 @ 1.69 1.69
DtPepsi 20oz #00012000001307
3 @ 1.69 5.07
Dura 4AAA #00041333662688
1 @ 2.39 2.39
FrtPch 28oz #00052000135138
1 @ 2.09 2.09
FruitShoot R #00699632001006
1 @ 0.99 0.99
GumAplRings #00028348900943
2 @ 0.59 1.18
GummyPchRing #00028348900950
1 @ 0.59 0.59
HerCook/Crm #00034000002399
1 @ 1.19 1.19
Hershey #00034000002405
2 @ 1.19 2.38
HersheyAlmon #00034000002412
1 @ 1.19 1.19
KitKat #00034000002467
1 @ 1.19 1.19
L&M Blue #00028200310026
1 @ 4.85 4.85
LayCls 1.5oz #00028400091565
1 @ 0.59 0.59
LaysClsBaked #00028400071888
1 @ 0.59 0.59
LifesaverGmy #00022000014641
1 @ 1.79 1.79
Lipton Peach #00012000112232
2 @ 1.69 3.38
M&M Peanut #00040000000327
2 @ 1.19 2.38
M&M Plain #00040000000310
3 @ 1.19 3.57
Marlb. Light #00028200003843
1 @ 5.25 5.25
Marlboro Red #00028200003577
1 @ 5.25 5.25
MarlbRedSB #00028200005656
1 @ 5.25 5.25
MDKS BlkCher #00012000043000
1 @ 1.69 1.69
MDKS Orange #00012000110443
2 @ 1.69 3.38
MelYel 20oz #00049000016796
1 @ 1.69 1.69
Monster LC #00070847811268
2 @ 2.59 4.00
Monster ZU #00070847012474
1 @ 2.59 2.59
Mott's Apple #00014800002294
1 @ 0.89 0.89
Munchies #00028400025287
1 @ 0.59 0.59
Orange Slice #00028348001756
1 @ 0.59 0.59
OrbitPprmint #00022000004864
1 @ 1.59 1.59
OrbitSprmint #00022000004840
1 @ 1.59 1.59
Payday King #00010700807274
2 @ 1.79 3.58
Powerade Fru #00049000003710
1 @ 1.59 1.59
Powerade MB #00049000007909
1 @ 1.59 1.59
RedBull 12oz #00611269818994
5 @ 2.99 14.95
Reese's #00034000004409
2 @ 1.19 2.38
Ruff Ch&SC #00028400002912
2 @ 0.89 1.78
SBFrapMoc9.5 #00012000006494
1 @ 2.19 2.19
SmartH2O (L) #00786162338006
1 @ 2.99 2.99
SmartH2O(SB) #00786162001511
2 @ 2.19 4.38
SnyPretzels #00077975022177
1 @ 0.89 0.89
Sour Skittle #00040000002666
1 @ 1.19 1.19
Sprite 20oz #00049000007640
2 @ 1.69 3.38
Sunbeam 4AA #00629312145133
1 @ 2.39 2.39
SunDrop 20oz #00078000230406
3 @ 1.69 5.07
Sunkist 20oz #00078000113402
2 @ 1.69 3.38
WasherFluid #00086834303616
1 @ 2.25 2.25
Winterfresh #00022000001788
2 @ 0.35 0.70
XtraPolarIce #00022000008985
1 @ 1.29 1.29
TOTAL SKU SALES LESS TAX 184.24
-------------------------------------
And file2:
Code: Select all
5hrEnergyBry #00719410500016
A Animal Crk #00079783459343
AirheadMyst #00073390002213
AmerSp Blue #00047995855086
Aquafina16oz #00012000001086
Aquafina20oz #00012000001598
B&M Wood Tip #00070137105251
Baby Ruth #00028000010775
BF Cups #00028000003555
BicLighter #00070330600065
Big Red King #00022000006684
Butterfinger #00028000202033
CaliTrailMix #00077449497548
Candy Corn #00028348001619
Cheez-It #00024100122615
Coke 20ozVan #00049000031171
Coke Can #00049000006346
Dasani20oz #00049000009774
DblMint King #00022000006660
DP H2O 16oz #00082657500638
Dt.Dr.P 20oz #00078000083408
DtCoke 20oz #00049000000450
DtPepsi 20oz #00012000001307
Dura 4AAA #00041333662688
FrtPch 28oz #00052000135138
FruitShoot R #00699632001006
GumAplRings #00028348900943
GummyPchRing #00028348900950
HerCook/Crm #00034000002399
Hershey #00034000002405
HersheyAlmon #00034000002412
KitKat #00034000002467
L&M Blue #00028200310026
LayCls 1.5oz #00028400091565
LaysClsBaked #00028400071888
LifesaverGmy #00022000014641
Lipton Peach #00012000112232
M&M Peanut #00040000000327
M&M Plain #00040000000310
Marlb. Light #00028200003843
Marlboro Red #00028200003577
MarlbRedSB #00028200005656
MDKS BlkCher #00012000043000
MDKS Orange #00012000110443
MelYel 20oz #00049000016796
Monster LC #00070847811268
Monster ZU #00070847012474
Mott's Apple #00014800002294
Munchies #00028400025287
Orange Slice #00028348001756
OrbitPprmint #00022000004864
OrbitSprmint #00022000004840
Payday King #00010700807274
Powerade Fru #00049000003710
Powerade MB #00049000007909
RedBull 12oz #00611269818994
Reese's #00034000004409
Ruff Ch&SC #00028400002912
SBFrapMoc9.5 #00012000006494
SmartH2O (L) #00786162338006
SmartH2O(SB) #00786162001511
SnyPretzels #00077975022177
Sour Skittle #00040000002666
Sprite 20oz #00049000007640
Sunbeam 4AA #00629312145133
SunDrop 20oz #00078000230406
Sunkist 20oz #00078000113402
WasherFluid #00086834303616
Winterfresh #00022000001788
XtraPolarIce #00022000008985
Dum-Dums #14
Ice Bag #20
KTC #1111
PaperFunnel #58
File2 seems to be a subset of File1, but how could you quickly check to see if any of the items in file2 don't exist in file1?
Normally, I'd somehow massage file1's format to look like file2 and then use FC. There are also ways to use a for loop to read in each line and do comparisons that way. But I wanted something even quicker and as a single command.
My solution was:
Code: Select all
FINDSTR /V /G:"FILE1" "FILE2"
with the results:
Code: Select all
Dum-Dums #14
Ice Bag #20
KTC #1111
PaperFunnel #58