根据变量放置数据(列)

时间:2016-03-17 09:24:15

标签: python

CustomerID  cs_cookie   cs_referer      cs_host sc_status   sc_substatus    sc_win32_status sc_bytes    cs_bytes    
  1     Kommarajula http    rewardcenter    200  0             0               3189           2767          62      
  2     Kommarajula http    rewardcenter    200  0             0              61828           2767         156      
  2     Kommarajula http    rewardcenter    200  0             0               3445           2750          62      
  3     Kommarajula http    rewardcenter    200  0             0              19738           2782          78      
  4     Kommarajula http    rewardcenter    200  0             0              19738           2781          78      
  5     Kommarajula v1:1    rewardcenter    200  0             0              51396           2253         374      
  6     Kommarajula v1:1    rewardcenter    200  0             0               2357           2201         124      
  7     Kommarajula v1:1    rewardcenter    200  0             0              19594           2243         140      
  8     Kommarajula Ram v1:1    rewardcenter    200            0                 0            22778       2425          109 
  9     Kommarajula Ram v1:1    rewardcenter    200            0                 0            28186       2460          296 
 10     Kommarajula Ram Kumar   v1:1    rewardcenter          200                0              0         28186         2460    296
 11     Kommarajula Ram Kumar   v1:1    rewardcenter          200                0              0         28186         2460    296

我有csv格式的IIS日志数据,但是“cs_cookie”变量已经溢出到很多列,我想在删除“cs_cookie”变量后将数据放入其对应的变量中。请帮帮我。

1 个答案:

答案 0 :(得分:0)

#include <iostream>
#include <unistd.h>

using namespace std;
void newline(); 

int main() {

int msec = 0;
int sec = 0;
int min = 0;
int hr = 0;


//cout << "Press any key to start:";
//char start = _gtech();

for (;;)
{
        newline();
                if(msec == 1000)
                {
                        ++sec;
                        msec = 0;
                }
                if(sec == 60)
                {
                        ++min;
                        sec = 0; 
                }
                if(min == 60)
                {
                        ++hr;
                        min = 0;
                }
        cout << hr << " : " << min << " : " << sec << " . " << msec << endl;
        ++msec;
        usleep(100000); 

}

    return 0;
}

void newline()
{
        cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
}