Tag Archives: VOE

How do i i use paste command in while condition??

By nikhil jain

there are lot of files where in mostly all the file contains 2columns

Code:

Code:


Al,1
Ail,13
Al,3
Al,1
Al,3
Al,2
Al,3
Al,1
Al,1
Al,1



My requirement is i wanted only the second column of every file as a column ony in the base file… I used paste command… but it is not helping as I’m using while condition.

Code:

Code:


while read dline
do
while read opline
do
grep $dline Combo_31Jan.csv|grep -i "$opline" |awk -F, '{print $1","$7}'>>combo_operncount.$dline.$opline
done < operator.txt
done < date.txt
while read dline
do
>blank.$dline
while read opline
do
#paste blank.$dline combo_operncount.$dline.$opline >> FC7DFILE.$opline

#mv FC7DFILE.$opline blank.$dline
done < operator.txt
done < date.txt



operator.txt and date.txt contains

Code:

Code:


operator.txt

AEL
AL
TMO
VOE

date.txt

2013-01-28
2013-01-29
2013-01-30
2013-01-31



…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Help require with counter

By nikhil jainI have this file

Code:

Code:
1801,A1,2012-12-16 15:59:59.995,id2_3,ab,phoneC2-00,VOE,,,,,,,,,,,,,,,
1802,A1,2012-12-16 15:59:59.995,id2_3,ab=,phoneX1-01,BL,,,,,,,,,,,,,,,
1803,A1,2012-12-16 15:59:59.995,id2_3,ab,phone300,BL,,,,,,,,,,,,,,,
1804,A1,2012-12-16 15:59:59.995,id2_3,ab,phoneC2-00,al,,,,,,,,,,,,,,,
1805,A1,2012-12-16 15:59:59.995,id2_3,ab,phoneX1-01,al,,,,,,,,,,,,,,,
1806,A1,2012-12-16 15:59:59.995,id2_3,ab,phoneX1-01,id,,,,,,,,,,,,,,,
1807,A1,2012-12-16 15:59:59.995,id2_3,ab,phoneX1-01,al,,,,,,,,,,,,,,,
1808,A1,2012-12-16 15:59:59.995,id2_3,ab,phone100,al,,,,,,,,,,,,,,,
1809,A1,2012-12-16 15:59:59.995,id2_3,ab,phone101,id,,,,,,,,,,,,,,,
1810,A1,2012-12-16 15:59:59.995,id2_3,ab,phone101,id,,,,,,,,,,,,,,,

the first column gives the count number of that row….. it begins from 1,2,3…

the file looks before processing like mentioned below

Code:

Code:
A1,2012-12-16 15:59:59.995,id2_3,ab=,phoneX1-01,BL,,,,,,,,,,,,,,,
A1,2012-12-16 15:59:59.995,id2_3,ab,phone300,BL,,,,,,,,,,,,,,,
A1,2012-12-16 15:59:59.995,id2_3,ab,phoneC2-00,al,,,,,,,,,,,,,,,
A1,2012-12-16 15:59:59.995,id2_3,ab,phoneX1-01,al,,,,,,,,,,,,,,,
A1,2012-12-16 15:59:59.995,id2_3,ab,phoneX1-01,id,,,,,,,,,,,,,,,
A1,2012-12-16 15:59:59.995,id2_3,ab,phoneX1-01,al,,,,,,,,,,,,,,,
A1,2012-12-16 15:59:59.995,id2_3,ab,phone100,al,,,,,,,,,,,,,,,
A1,2012-12-16 15:59:59.995,id2_3,ab,phone101,id,,,,,,,,,,,,,,,
A1,2012-12-16 15:59:59.995,id2_3,ab,phone101,id,,,,,,,,,,,,,,,

Source: The UNIX and Linux Forums