火狐浏览器下载csv文件
Background
背景
Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc...
仍然必须处理从所有这些来源(包括政府实体)收到的所有这些年终“ csv”文件,有时由于数据错误等原因,我们需要检查内容。
As a "Unix" shop, our only readily available tool was the "vi" editor, which is of little help when the records are too long or the size of the file is too big or the number of records is too numerous.
作为“ Unix”商店,我们唯一易于使用的工具是“ vi”编辑器,当记录太长或文件大小太大或记录数太多时,它几乎没有帮助。
Unfortunately, we are not allowed to install any of 3rd party (free or not) utilities out there.
不幸的是,我们不允许在那里安装任何第三方软件(无论是否免费)。
What could we do?
我们该怎么办?
Solution: csvb - a Quick and Dirty CSV File Browser
解决方案: csvb-快速而肮脏的CSV文件浏览器
The program is written in ksh shell and awk and will take the following parameters :
该程序是用ksh shell和awk编写的,将采用以下参数:
Option Description Default
-d Field delimiter Comma ','
-h The file has header row 1 = Yes
-p Starting record to display 1 = Default
-n Number of records to display 1 = Default, 0 = All
-q Quoted fieds " = Default
-c Number of columns in display 2 = Default, 3 = Max
-? Display the help message
Program code is attached.
附加了程序代码。
Sample output
样品输出
==> csvb -h1 -n 3 -p 100 SAM_Exclusions_Public_Extract_14014t.csv
-e #------------------------------------------------------
#
# /usr/local/bin/csvb Arguments:
#
# -d , <= delimiter (',' =default)
# -q " <= quote's ("=default)
# -c 2 <= #output cols to display (2=default,max=3)
# -p 100 <= starting record (1=default)
# -n 3 <= #recs to display of 121872 (0=all,1=default)
# -h 1 <= file has header row (1=Yes)
#
# Source file: SAM_Exclusions_Public_Extract_14014t.csv
#
#------------------------------------------------------
#
#*** File: SAM_Exclusions_Public_Extract_14014t.csv[,] - Starting rec# 100, display 3 recs.
#*** Header (26 columns): Classification,Name,Prefix,First,Middle,Last,Suffix,Address 1,Address 2,Address 3,Address 4,City,State / Province,Country,Zip Code,DUNS,Exclusion Program,Excluding Agency,CT Code,Exclusion Type,Additional Comments,Active Date,Termination Date,Record Status,Cross-Reference,SAM Number
*** Rec#100 - 1/3 (NF38): SAM_Exclusions_Public_Extract_14014t.csv
Classification 01: Individual Country 14: USA
Name 02: Zip Code 15: 33179
Prefix 03: DUNS 16:
First 04: A. Exclusion Program 17: Reciprocal
Middle 05: JUMBO Excluding Agency 18: EPA
Last 06: MCDONALD CT Code 19:
Suffix 07: Exclusion Type 20: Ineligible (Proceedings *
Address 1 08: Additional Comments 21:
Address 2 09: Active Date 22: 8/12/2009
Address 3 10: Termination Date 23: 8/11/2014
Address 4 11: Record Status 24:
City 12: MIAMI Cross-Reference 25: "(also MCDONALD JUMBO, M*
State / Province 13: FL SAM Number 26: S4MR3QH7L
*** Rec#101 - 2/3 (NF26): SAM_Exclusions_Public_Extract_14014t.csv
Classification 01: Individual Country 14: GBR
Name 02: Zip Code 15: EC2V 8EY
Prefix 03: DUNS 16:
First 04: A. Exclusion Program 17: Reciprocal
Middle 05: LOPEZ Excluding Agency 18: TREAS-OFAC
Last 06: MIGUEL CT Code 19: 03-SDN-01
Suffix 07: Exclusion Type 20: Prohibition/Restriction
Address 1 08: Additional Comments 21: PII data has been masked*
Address 2 09: Active Date 22:
Address 3 10: Termination Date 23: Indefinite
Address 4 11: Record Status 24:
City 12: LONDON Cross-Reference 25:
State / Province 13: SAM Number 26: S4MR3QS26
*** Rec#102 - 3/3 (NF27): SAM_Exclusions_Public_Extract_14014t.csv
Classification 01: Individual Country 14: USA
Name 02: Zip Code 15: 105460413
Prefix 03: DUNS 16:
First 04: A. Exclusion Program 17: Reciprocal
Middle 05: STEPHEN Excluding Agency 18: HHS
Last 06: PACK CT Code 19: Z1
Suffix 07: Exclusion Type 20: Prohibition/Restriction
Address 1 08: Additional Comments 21: "Excluded by the Departm*
Address 2 09: Active Date 22: 9/20/2000
Address 3 10: Termination Date 23: Indefinite
Address 4 11: Record Status 24:
City 12: MILLWOOD Cross-Reference 25:
State / Province 13: NY SAM Number 26: S4MR3QVGD
CODE is here:
代码在这里:
csvb.sh csvb.shNO WARRANTY
没有保修
THE PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY. IT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
该程序是在希望的情况下分发的,但没有任何保证。 本文档按“原样”提供,不提供任何形式的明示或暗示担保,包括但不限于对适销性和特定用途适用性的默示担保。 有关程序质量和性能的全部风险由您承担。 如果程序证明是无效的,则您承担所有必要的服务,维修或纠正的费用。
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW THE AUTHOR WILL BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
在任何情况下,除非适用法律另有规定,否则作者不对您承担损害赔偿责任,包括由于使用或无法使用程序而引起的任何一般性,特殊,偶发或继发性损害(包括但不限于数据或数据丢失)即使您已告知作者可能发生此类损害,也应视您或第三方的准确性或损失而定,或者该计划无法与任何其他程序一起运行)。
翻译自: https://www.experts-exchange.com/articles/12955/Quick-and-Dirty-Unix-CSV-File-Browser.html
火狐浏览器下载csv文件