HI
I want to convert 2nd column to row. but I am getting terminal name also along with the o/p
I am using below command
cat test | awk -F"," '{printf $2"\t" }'
getting below o/p
1237537 57956 923 0 33 435208 67 1 14 [cipher@test]#
how can I avoid printing this
[cipher@test]#
as this should be come in the next line.
which usually comes if we run any other command
for example for below command
[cipher@test]#
automatically coming to next line.
[cipher@test]#echo hello
hello
[cipher@test]#
joeyg
2
That [cipher@test]# is your prompt.
Not sure what you mean - are you trying to change your prompt or force a <CR><LF> after your output?
Instead of "\t" you could try "\n"
Ralph
3
You could use print instead of printf. Or add a newline to the parameters for printf:
$ echo -n e,2,t,y,1,f | awk -F"," '{ printf $3"\t" "\n"}'
t
$ echo -n e,2,t,y,1,f | awk -F"," '{ print $3"\t" }'
t
$
HI Have input file as below
1,1237537
2,57956
3,923
4,0
5,33
6,435208
7,67
8,1
9,14
I want o/p as below
1237537 57956 923 0 33 435208 67 1 14
but I am getting as below which I don't want
1237537 57956 923 0 33 435208 67 1 14 [cipher@test]#
how to avoid printing this
[cipher@test]#
RudiC
5
Did you read and understand posts #2 and #3?