( ! ) Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKBase.class.php on line 114
Call Stack
#TimeMemoryFunctionLocation
10.0007413840{main}( ).../index.php:0
20.07534264416Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.474915935224Joomla\CMS\Application\SiteApplication->render( ).../CMSApplication.php:202
40.475015935280Joomla\CMS\Application\SiteApplication->render( ).../SiteApplication.php:778
50.475115935656Joomla\CMS\Document\HtmlDocument->parse( ).../CMSApplication.php:1030
60.475115935656Joomla\CMS\Document\HtmlDocument->_fetchTemplate( ).../HtmlDocument.php:545
70.475215935752Joomla\CMS\Document\HtmlDocument->_loadTemplate( ).../HtmlDocument.php:730
80.475515973992require( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/component.php' ).../HtmlDocument.php:668
90.480916265936GKTemplate->__construct( ).../component.php:31
100.489316419816GKTemplateMenu->getMenuType( ).../gk.framework.php:84
110.490016463784require_once( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKMenu.php' ).../helper.menu.php:19

( ! ) Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKHandheld.php on line 76
Call Stack
#TimeMemoryFunctionLocation
10.0007413840{main}( ).../index.php:0
20.07534264416Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.474915935224Joomla\CMS\Application\SiteApplication->render( ).../CMSApplication.php:202
40.475015935280Joomla\CMS\Application\SiteApplication->render( ).../SiteApplication.php:778
50.475115935656Joomla\CMS\Document\HtmlDocument->parse( ).../CMSApplication.php:1030
60.475115935656Joomla\CMS\Document\HtmlDocument->_fetchTemplate( ).../HtmlDocument.php:545
70.475215935752Joomla\CMS\Document\HtmlDocument->_loadTemplate( ).../HtmlDocument.php:730
80.475515973992require( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/component.php' ).../HtmlDocument.php:668
90.480916265936GKTemplate->__construct( ).../component.php:31
100.492016587032GKTemplateMenu->getMenuType( ).../gk.framework.php:85
按行数分割
Logo
Print this page

按行数分割

有个文件要处理,因为很大,所以想把它切成若干份,每份N行,以便并行处理。怎么搞呢?查了下强大的shell,果然有现成的工具--split
下面记录下基本用法:

 
  1. split [-bl] file [prefix]  


参数说明:

-b, --bytes=SIZE:对file进行切分,每个小文件大小为SIZE。可以指定单位b,k,m
-l, --lines=NUMBER:对file进行切分,每个文件有NUMBER行。

prefix:分割后产生的文件名前缀。

 

示例:

假设要切分的文件为test.2012-08-16_17,大小1.2M12081行。

1)

 
  1. split -l 5000 test.2012-08-16_17  

生成xaaxabxac三个文件。
wc -l 看到三个文件行数如下:
5000 xaa
5000 xab
2081 xac

  1. 总计

2) 

  1. split -b 600k test.2012-08-16_17  

生成xaaxab两个文件
ls -lh 看到 两个文件大小如下:
600K xaa

  1. xab

3)

 
  1. split -b 500k test.2012-08-16_17 example  

得到三个文件,文件名的前缀都是example
ls -lh 看到文件信息如下:
500K exampleaa
500K exampleab
154K exampleac

Last modified onWednesday, 05 June 2013 09:01

( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169
Call Stack
#TimeMemoryFunctionLocation
10.0007413840{main}( ).../index.php:0
20.07534264416Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.07534264416Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.359811455528Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.360411479856Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.361111535184Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.361411562584require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.369511962216K2ControllerItem->execute( ).../k2.php:64
90.369511962216K2ControllerItem->display( ).../BaseController.php:710
100.379112612920K2ControllerItem->display( ).../item.php:78
110.379112612920K2ControllerItem->display( ).../controller.php:19
120.383412983960Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.386213004328K2ViewItem->display( ).../ViewController.php:102
140.468215830424K2ViewItem->display( ).../view.html.php:742
150.468215830424K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.470516003360include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ).../HtmlView.php:701
  • Published in reaver
  • Read 2689 times

( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478
Call Stack
#TimeMemoryFunctionLocation
10.0007413840{main}( ).../index.php:0
20.07534264416Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.07534264416Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.359811455528Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.360411479856Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.361111535184Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.361411562584require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.369511962216K2ControllerItem->execute( ).../k2.php:64
90.369511962216K2ControllerItem->display( ).../BaseController.php:710
100.379112612920K2ControllerItem->display( ).../item.php:78
110.379112612920K2ControllerItem->display( ).../controller.php:19
120.383412983960Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.386213004328K2ViewItem->display( ).../ViewController.php:102
140.468215830424K2ViewItem->display( ).../view.html.php:742
150.468215830424K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.470516003360include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ).../HtmlView.php:701
Template Design © Joomla Templates | GavickPro. All rights reserved.