创建报告并上传到服务器进行下载 [英] Create report and upload to server for download

查看:95
本文介绍了创建报告并上传到服务器进行下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个CSV文件,大小为300MB,有超过50万条记录。



以下是数据结构:

  A; B; C; D; E; F; G 

解决方案

p>我今天做一个衬垫,和solr似乎过度杀伤。这里有一个解决你的问题(假设没有标题行):

  sort -t \; -k2 < test.csv | head -50 

如果您需要第二个字段,而不是按字母顺序排序,请添加-n。


I have a CSV file thats 300MB and has over 1/2 million entries. I want to run reports and make these reports available for download.

Here's the data structure:

A;B;C;D;E;F;G

What I'd like to do is create a separate file that contains the top 50 rows when the file has been sorted by column B.

解决方案

I'm making one liners today, and Solr seems like overkill. Here's one to solve your problem (assuming no header row):

sort -t\; -k2 < test.csv | head -50

Add -n if you need the second field sorted numerically instead of alphabetically.

这篇关于创建报告并上传到服务器进行下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆