You are here: PSPad forum > English discussion forum > compare files and picking the diff lines out

compare files and picking the diff lines out

#1 compare files and picking the diff lines out

Posted by: djehres | Date: 04/24/2012 22:22 | IP: IP Logged

I have two files. One is part numbers like below:

189170-1
189170-2
JSFL27-24A
JSFM07A14FH14
JSFM07A14FJ12
JSFM07A14FK10
JSFM07A14FK14
JSFM07A15BH12
JSFM07A15CJ52
JSFM07A15CJ56

the other file is 20,000 parts with more info on each line like below (the first column is always the part number):

18002600|92867||Y|A|EA|0|0|0|N|CABLE,CONTROL ASSEM|0|0|*|0|PAOZZN|N|12|N|N|VPS|N|N|N|N|CABLE,CONTROL ASSEM|0|||Receive into Inventory|81755|18002600|*|*|*|0|0||18002600|A|*|*
181-001-126|06324||Y|A|EA|0|0|0|N|CONTACT,MIL-DTL-389|0|0|*|0|PAOZZN|N|12|N|N|VPS|N|N|N|N|CONTACT,MIL-DTL-389|0|||Receive into Inventory|81755|181-001-126|*|*|*|0|0||181-001-126|A|*|*
181-001-S|06324||Y|A|EA|0|0|0|N|ALIGNMENT SLEEVE|0|0|*|0|PAOZZN|N|12|N|N|VPS|N|N|N|N|ALIGNMENT SLEEVE|0|||Receive into Inventory|81755|181-001-S|*|*|*|0|0||181-001-S|A|*|*
181-002-126|06324||Y|A|EA|0|0|0|N|CONTACT,MIL-DTL-389|0|0|*|0|PAOZZN|N|12|N|N|VPS|N|N|N|N|CONTACT,MIL-DTL-389|0|||Receive into Inventory|81755|181-002-126|*|*|*|0|0||181-002-126|A|*|*
181-048-16|06324||Y|A|EA|0|0|0|N|CONTACT,MIL-DTL-389|0|0|*|0|PAOZZN|N|12|N|N|VPS|N|N|N|N|CONTACT,MIL-DTL-389|0|||Receive into Inventory|81755|181-048-16|*|*|*|0|0||181-048-16|A|*|*
189170-1|U0E16||X|A|EA|0|0|0|N|SE HOIST, RT|1|0|*|0|PEOOKS|N|18|N|N|VPS|N|N|N|N|SE HOIST, RT|19|||Receive into Inventory|81755|189170-1|*|*|*|1|0||189170-1|A|*|*
189170-2|U0E16||X|A|EA|0|0|0|N|SE HOIST, LT|1|0|*|0|PEOOKS|N|18|N|N|VPS|N|N|N|N|SE HOIST, LT|19|||Receive into Inventory|81755|189170-2|*|*|*|1|0||189170-2|A|*|*
189T061M2504-7|06324||Y|A|EA|0|0|0|N|BACKSHELL,D-SUBMINI|0|0|*|0|PAOZZN|N|12|N|N|VPS|N|N|N|N|BACKSHELL,D-SUBMINI|0|||Receive into Inventory|81755|189T061M2504-7|*|*|*|0|0||189T061M2504-7|A|*|*
1958039-1|00779||Y|A|EA|0|0|0|N|TERMINAL LUG,RING T|0|0|*|0|PAOZZN|N|12|N|N|VPS|N|N|N|N|TERMINAL LUG,RING T|0|||Receive into Inventory|81755|1958039-1|*|*|*|0|0||1958039-1|A|*|*
1958040-1|00779||Y|A|EA|0|0|0|N|TERMINAL LUG,RING T|0|0|*|0|PAOZZN|N|12|N|N|VPS|N|N|N|N|TERMINAL LUG,RING T|0|||Receive into Inventory|81755|1958040-1|*|*|*|0|0||1958040-1|A|*|*
1958041-1|00779||Y|A|EA|0|0|0|N|TERMINAL LUG,RING T|0|0|*|0|PAOZZN|N|12|N|N|VPS|N|N|N|N|TERMINAL LUG,RING T|0|||Receive into Inventory|81755|1958041-1|*|*|*|0|0||1958041-1|A|*|*

how do I comare the first file to the second and pull the lines of part number and the rest of the line from the second file in an efficient manner?

thanks.

Options: Reply | Quote | Up ^


#2 Re: compare files and picking the diff lines out

Posted by: pspad | Date: 04/25/2012 06:08 | IP: IP Logged

Sorry, but it uncomparamble by standard way.
Normally I will use some DB tool after I will transform content of second file into DB table.

Options: Reply | Quote | Up ^


#3 Re: compare files and picking the diff lines out

Posted by: jlrjlr | Date: 04/30/2012 19:17 | IP: IP Logged

To just extract a few lines, a workaround could using the script "filter lines".

On the top of the "all parts" file put one item,
select it
use Script/filterlines/filter for selection
the part line should be in a new document

if this work ok (i.e the part number is 'unique' enough to extract only one part) you can use the following syntax (regexp)to extract several parts in one search
(part1|part2|part3)

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2014 Jan Fiala
Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák