#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    3
    Rep Power
    0

    Need help regarding extracting columns


    i have two text files where one file contains all the system calls n ano file contains 5 columns of which one column contains system calls.....

    i need to match d sys calls if its present den i need to record the values of column(no_of_calls) value if its nt present den record 0 in dat syscall value....

    Can any1 plz help me out i m even to python
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,905
    Rep Power
    481
    Please post example input files and the matching output. Use English. You know how to write "the".
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    3
    Rep Power
    0
    Originally Posted by b49P23TIvg
    Please post example input files and the matching output. Use English. You know how to write "the".
    Sorry for the typo error....

    input is two files
    One file contains 160 system calls
    for ex: _exit:exit_group,_exit_thread:exit,fork,waitpid,waitid,clone,execve,setuid32,getuid32,getgid32,geteu id32,getegid32......... etc

    another file(FILE NO 2) contains:

    % time seconds usecs/call calls errors syscall
    ------ ----------- ----------- --------- --------- ----------------
    19.37 18.719329 6920 2705 clock_gettime
    14.19 13.719140 15312 896 epoll_wait
    13.38 12.929801 7947 1627 ioctl
    12.22 11.811341 8068 1464 5 futex
    10.86 10.492870 7395 1419 getpid


    I need to extract calls column for the corresponding syscall column and if the syscall is not present in file no 2, make it entry as 0.

    file no 2 contains 6 columns, error column has value for very few syscall.. For the above mentioned sample file no 2 contains none of the them have error column values

    example output

    clock_gettime 2705
    epoll_wait 896
    ioctl 1627
    futex 1464
    getpid 1419
    waitpid 0
    fork 0
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    3
    Rep Power
    0
    Plz can you help me out in the problem

IMN logo majestic logo threadwatch logo seochat tools logo