compare

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
santhosh
Posts: 41
Joined: 02 Aug 2010 05:10

compare

#1 Post by santhosh » 14 Oct 2010 07:52

Hi ghost critical problem for me.can u help me

file1.csv
GJR10101315511000145,22093165,96734353,250,GJR,UER
HPR10101318071200662,57298772,03289112,250,HPR,DLR
HPR10101317581100059,57651616,02894754,250,HPR,DLR
HRR10101318031000352,02190237,03963371,250,HRR,DLR
HRR10101322141200125,02191868,03426983,250,HRR,DLR
HRR10101318071100028,02192292,77203779,250,HRR,BHR
KOR10101317231000008,04090878,14635365,250,KOR,WBR
KOR10101315171200004,04798063,14367284,250,KOR,WBR
KOR10101316291200024,13996348,97000215,250,KOR,BHR

file2.csv
KOR10101315511000150,57457784,250
GJR10101315511000145,96734353,250
UER10101315511000150,66734353,200
HRR10101315511000151,96734353,206
UER10101315511000164,96734353,200
UER10101319451200169,96734353,250
GJR10101315511000145,96734353,206
........
.n numbers.....
.......
GHR10101315511000150,36646466,200
HPR10101318071200662,03289112,250
HPR10101318071200662,03289112,206
DLR10101318071200664,03289112,206

OUTPUT:
FILE3.CSV
UER10101315511000164,96734353,200
DLR10101318071200664,03289112,206

Let me explain..
now i have to get column 1 removing first three character in file1.csv Eg:-like(10101315511000145) and add that 6th column to it like(UER10101315511000145).Now from 145 i have to increament+1 till 999 to it and compare column1 from file2 whichever number appears first it should display that line from file2.csv....so here i get UER10101315511000150 but 2nd colum doesnt matches to 3rd column in file1..so i have to go for next increament which matches that too.

thanks in advance

ghostmachine4
Posts: 319
Joined: 12 May 2006 01:13

Re: compare

#2 Post by ghostmachine4 » 14 Oct 2010 08:25

i can do it for you, but the problem is, that's really your job, not mine. At least show me what you have done so far.

santhosh
Posts: 41
Joined: 02 Aug 2010 05:10

Re: compare

#3 Post by santhosh » 14 Oct 2010 10:24

yes ghost ur right...as i am newbie i tried my level best........i will show u wat i done

santhosh
Posts: 41
Joined: 02 Aug 2010 05:10

Re: compare

#4 Post by santhosh » 15 Oct 2010 00:51

sorry ghost ...
u help me ..blank line is coming for me. :cry:

santhosh
Posts: 41
Joined: 02 Aug 2010 05:10

Re: compare

#5 Post by santhosh » 18 Oct 2010 07:16

hi ghost solve it plz :|

ghostmachine4
Posts: 319
Joined: 12 May 2006 01:13

Re: compare

#6 Post by ghostmachine4 » 18 Oct 2010 07:59

show us what you have done and where you are stuck.

Post Reply