sfaqih
November 2, 2008, 8:27am
1
Dear all,
I have output in file like below:
and I need to append number starts from 901 til 909 to the end of each line please help.
109;0;109
109;1001;109
109;101;109
109;102;109
109;1101;109
109;1301;109
109;1401;109
109;162;109
109;1;109
109;201;109
109;202;109
109;216;109
109;252;109
109;301;109
109;302;109
109;401;109
109;402;109
109;501;109
109;502;109
109;58;109
109;601;109
109;602;109
109;701;109
109;702;109
109;7071;109
109;71;109
thanks
i am not understating what ur what and where are u trying to append, Provide a sample output as well.
sfaqih
November 3, 2008, 12:43am
3
Thanks Pbsrinivas for your reply...
What I mean is that the output i have like:
109;0;109
109;1001;109
109;101;109
109;102;109
109;1101;109
109;1301;109
109;1401;109
109;162;109
109;1;109
109;201;109
109;202;109
109;216;109
109;252;109
109;301;109
109;302;109
109;401;109
109;402;109
109;501;109
109;502;109
109;58;109
109;601;109
109;602;109
109;701;109
109;702;109
109;7071;109
109;71;109
and I need to append numbers starts from 901 and the new output should be like the below:
109;0;109901
109;1001;109902
109;101;109903
109;102;109904
109;1101;109905
109;1301;109906
109;1401;109907
109;162;109908
109;1;109909
109;201;1099010
109;202;1099011
109;216;1099012
109;252;1099013
109;301;1099014
109;302;1099015
see that I append the values in the end of each line sequentially but see that when I reached number 909 it should jumb to 9010 then increase the number 9010 with one number 9011 and 9012 and so on so forth.
please I'm waiting for a reply.
nawk '{a=900+NR;print$0a;}' filename
sfaqih
November 3, 2008, 2:31am
5
Thanks summer_cherry,
your code give me the same results I have with another command which is:
j=$[$j+1] as j is the variable set with value 901.
but the problem now that I need to jump from value 909 to value 9010 instead of continue with 909,910,911.
I need it in like: 909,9010,9011,9012......
so the output should be like this:
109;0;109901
109;1001;109902
109;101;109903
109;102;109904
109;1101;109905
109;1301;109906
109;1401;109907
109;162;109908
109;1;109909
109;201;1099010
109;202;1099011
109;216;1099012
109;252;1099013
109;301;1099014
109;302;1099015