如果我的数据是:
06310,smith,sales manager,this is smith.
he is a sales manager.
06511,allen.w,tech manager,this is allen.w.
he is a tech manager.
05516,blake,hr manager,this is blake.
he is a he manager.
07055,james,sales manager,this is james.
he is a sales manager.
08559,jack,hr manager,this is jack.
he is a hr manager.
04998,nick,tech manager,this is nick.
he is a tech manager.
我的“var n”的n为多少?

解决方案 »

  1.   

    var 3表示,每一行数据的前3个字符为指示该行记录的长度。n为多少根据你自己来定,你可以3个字符(字节)表示长度,也可以用4个字符来表示长度。
    不足前面可以补0。
    但是该数字为后面每行记录的具体长度值。例:你有一行数据的实际长度为值为60(所有其它行长度也不超过99),
    那么你至少要用2位字符来表示该值,即"var 2"
    60aabb zhangsan...........也可以用3位字符来表示该值060,"var 3"
    060aabb zhangsan...........