Extract column from file with shell [duplicate]












-2
















This question already has an answer here:




  • bash: shortest way to get n-th column of output

    8 answers




I would like to extract column number 8 from the following table using shell (ash):



0xd024  2       0       32      20      3       0       1       0       2       1384    1692    -61     27694088
0xd028 0 1 5 11 1 0 46 0 0 301 187 -74 27689154
0xd02c 0 0 35 14 1 0 21 0 0 257 250 -80 27689410
0xd030 1 1 15 13 1 0 38 0 0 176 106 -91 27689666
0xd034 1 1 50 20 1 0 8 0 0 790 283 -71 27689980
0xd038 0 0 0 3 4 0 89 0 0 1633 390 -90 27690291
0xd03c 0 0 8 3 3 0 82 0 0 1837 184 -95 27690603
0xd040 0 0 4 5 1 0 90 0 0 0 148 -97 27690915
0xd064 0 0 36 9 1 0 29 0 0 321 111 -74 27691227
0xd068 0 0 5 14 14 0 40 0 0 8066 2270 -85 27691539
0xd06c 1 1 39 19 1 0 15 0 0 1342 261 -74 27691850
0xd070 0 0 12 11 1 0 53 0 0 203 174 -73 27692162
0xd074 0 0 18 2 1 0 75 0 0 301 277 -94 27692474


How can I do that?










share|improve this question















marked as duplicate by John Kugelman shell
Users with the  shell badge can single-handedly close shell questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 20:06


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • the purpose is to extract the row

    – Anis_Stack
    Nov 27 '18 at 19:43











  • I mean the column number 8

    – Anis_Stack
    Nov 27 '18 at 19:49








  • 1





    ok then awk '{print $8}' file

    – anubhava
    Nov 27 '18 at 19:50











  • it works , thx @anubhava

    – Anis_Stack
    Nov 27 '18 at 19:55








  • 1





    awk '{print $2, $8}' file

    – anubhava
    Nov 27 '18 at 20:12
















-2
















This question already has an answer here:




  • bash: shortest way to get n-th column of output

    8 answers




I would like to extract column number 8 from the following table using shell (ash):



0xd024  2       0       32      20      3       0       1       0       2       1384    1692    -61     27694088
0xd028 0 1 5 11 1 0 46 0 0 301 187 -74 27689154
0xd02c 0 0 35 14 1 0 21 0 0 257 250 -80 27689410
0xd030 1 1 15 13 1 0 38 0 0 176 106 -91 27689666
0xd034 1 1 50 20 1 0 8 0 0 790 283 -71 27689980
0xd038 0 0 0 3 4 0 89 0 0 1633 390 -90 27690291
0xd03c 0 0 8 3 3 0 82 0 0 1837 184 -95 27690603
0xd040 0 0 4 5 1 0 90 0 0 0 148 -97 27690915
0xd064 0 0 36 9 1 0 29 0 0 321 111 -74 27691227
0xd068 0 0 5 14 14 0 40 0 0 8066 2270 -85 27691539
0xd06c 1 1 39 19 1 0 15 0 0 1342 261 -74 27691850
0xd070 0 0 12 11 1 0 53 0 0 203 174 -73 27692162
0xd074 0 0 18 2 1 0 75 0 0 301 277 -94 27692474


How can I do that?










share|improve this question















marked as duplicate by John Kugelman shell
Users with the  shell badge can single-handedly close shell questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 20:06


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • the purpose is to extract the row

    – Anis_Stack
    Nov 27 '18 at 19:43











  • I mean the column number 8

    – Anis_Stack
    Nov 27 '18 at 19:49








  • 1





    ok then awk '{print $8}' file

    – anubhava
    Nov 27 '18 at 19:50











  • it works , thx @anubhava

    – Anis_Stack
    Nov 27 '18 at 19:55








  • 1





    awk '{print $2, $8}' file

    – anubhava
    Nov 27 '18 at 20:12














-2












-2








-2









This question already has an answer here:




  • bash: shortest way to get n-th column of output

    8 answers




I would like to extract column number 8 from the following table using shell (ash):



0xd024  2       0       32      20      3       0       1       0       2       1384    1692    -61     27694088
0xd028 0 1 5 11 1 0 46 0 0 301 187 -74 27689154
0xd02c 0 0 35 14 1 0 21 0 0 257 250 -80 27689410
0xd030 1 1 15 13 1 0 38 0 0 176 106 -91 27689666
0xd034 1 1 50 20 1 0 8 0 0 790 283 -71 27689980
0xd038 0 0 0 3 4 0 89 0 0 1633 390 -90 27690291
0xd03c 0 0 8 3 3 0 82 0 0 1837 184 -95 27690603
0xd040 0 0 4 5 1 0 90 0 0 0 148 -97 27690915
0xd064 0 0 36 9 1 0 29 0 0 321 111 -74 27691227
0xd068 0 0 5 14 14 0 40 0 0 8066 2270 -85 27691539
0xd06c 1 1 39 19 1 0 15 0 0 1342 261 -74 27691850
0xd070 0 0 12 11 1 0 53 0 0 203 174 -73 27692162
0xd074 0 0 18 2 1 0 75 0 0 301 277 -94 27692474


How can I do that?










share|improve this question

















This question already has an answer here:




  • bash: shortest way to get n-th column of output

    8 answers




I would like to extract column number 8 from the following table using shell (ash):



0xd024  2       0       32      20      3       0       1       0       2       1384    1692    -61     27694088
0xd028 0 1 5 11 1 0 46 0 0 301 187 -74 27689154
0xd02c 0 0 35 14 1 0 21 0 0 257 250 -80 27689410
0xd030 1 1 15 13 1 0 38 0 0 176 106 -91 27689666
0xd034 1 1 50 20 1 0 8 0 0 790 283 -71 27689980
0xd038 0 0 0 3 4 0 89 0 0 1633 390 -90 27690291
0xd03c 0 0 8 3 3 0 82 0 0 1837 184 -95 27690603
0xd040 0 0 4 5 1 0 90 0 0 0 148 -97 27690915
0xd064 0 0 36 9 1 0 29 0 0 321 111 -74 27691227
0xd068 0 0 5 14 14 0 40 0 0 8066 2270 -85 27691539
0xd06c 1 1 39 19 1 0 15 0 0 1342 261 -74 27691850
0xd070 0 0 12 11 1 0 53 0 0 203 174 -73 27692162
0xd074 0 0 18 2 1 0 75 0 0 301 277 -94 27692474


How can I do that?





This question already has an answer here:




  • bash: shortest way to get n-th column of output

    8 answers








shell ash






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 '18 at 20:03









John Kugelman

245k54406459




245k54406459










asked Nov 27 '18 at 18:51









Anis_StackAnis_Stack

1,50921632




1,50921632




marked as duplicate by John Kugelman shell
Users with the  shell badge can single-handedly close shell questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 20:06


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by John Kugelman shell
Users with the  shell badge can single-handedly close shell questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 20:06


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • the purpose is to extract the row

    – Anis_Stack
    Nov 27 '18 at 19:43











  • I mean the column number 8

    – Anis_Stack
    Nov 27 '18 at 19:49








  • 1





    ok then awk '{print $8}' file

    – anubhava
    Nov 27 '18 at 19:50











  • it works , thx @anubhava

    – Anis_Stack
    Nov 27 '18 at 19:55








  • 1





    awk '{print $2, $8}' file

    – anubhava
    Nov 27 '18 at 20:12



















  • the purpose is to extract the row

    – Anis_Stack
    Nov 27 '18 at 19:43











  • I mean the column number 8

    – Anis_Stack
    Nov 27 '18 at 19:49








  • 1





    ok then awk '{print $8}' file

    – anubhava
    Nov 27 '18 at 19:50











  • it works , thx @anubhava

    – Anis_Stack
    Nov 27 '18 at 19:55








  • 1





    awk '{print $2, $8}' file

    – anubhava
    Nov 27 '18 at 20:12

















the purpose is to extract the row

– Anis_Stack
Nov 27 '18 at 19:43





the purpose is to extract the row

– Anis_Stack
Nov 27 '18 at 19:43













I mean the column number 8

– Anis_Stack
Nov 27 '18 at 19:49







I mean the column number 8

– Anis_Stack
Nov 27 '18 at 19:49






1




1





ok then awk '{print $8}' file

– anubhava
Nov 27 '18 at 19:50





ok then awk '{print $8}' file

– anubhava
Nov 27 '18 at 19:50













it works , thx @anubhava

– Anis_Stack
Nov 27 '18 at 19:55







it works , thx @anubhava

– Anis_Stack
Nov 27 '18 at 19:55






1




1





awk '{print $2, $8}' file

– anubhava
Nov 27 '18 at 20:12





awk '{print $2, $8}' file

– anubhava
Nov 27 '18 at 20:12












1 Answer
1






active

oldest

votes


















0














the following command "awk '{print $8}' file" works fine






share|improve this answer


























  • This comment shouldn't not be posted as answer.

    – anubhava
    Nov 27 '18 at 20:00











  • is it possible to extract 2 colums ?

    – Anis_Stack
    Nov 27 '18 at 20:06




















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














the following command "awk '{print $8}' file" works fine






share|improve this answer


























  • This comment shouldn't not be posted as answer.

    – anubhava
    Nov 27 '18 at 20:00











  • is it possible to extract 2 colums ?

    – Anis_Stack
    Nov 27 '18 at 20:06


















0














the following command "awk '{print $8}' file" works fine






share|improve this answer


























  • This comment shouldn't not be posted as answer.

    – anubhava
    Nov 27 '18 at 20:00











  • is it possible to extract 2 colums ?

    – Anis_Stack
    Nov 27 '18 at 20:06
















0












0








0







the following command "awk '{print $8}' file" works fine






share|improve this answer















the following command "awk '{print $8}' file" works fine







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 27 '18 at 20:05

























answered Nov 27 '18 at 19:54









Anis_StackAnis_Stack

1,50921632




1,50921632













  • This comment shouldn't not be posted as answer.

    – anubhava
    Nov 27 '18 at 20:00











  • is it possible to extract 2 colums ?

    – Anis_Stack
    Nov 27 '18 at 20:06





















  • This comment shouldn't not be posted as answer.

    – anubhava
    Nov 27 '18 at 20:00











  • is it possible to extract 2 colums ?

    – Anis_Stack
    Nov 27 '18 at 20:06



















This comment shouldn't not be posted as answer.

– anubhava
Nov 27 '18 at 20:00





This comment shouldn't not be posted as answer.

– anubhava
Nov 27 '18 at 20:00













is it possible to extract 2 colums ?

– Anis_Stack
Nov 27 '18 at 20:06







is it possible to extract 2 colums ?

– Anis_Stack
Nov 27 '18 at 20:06







Popular posts from this blog

Contact image not getting when fetch all contact list from iPhone by CNContact

count number of partitions of a set with n elements into k subsets

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks