由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - error of couting total line number in txt file on MSDOS (转载)
相关主题
sql数据库实时更新问题求教:
how to remote access to SQLserver DB?做机问题请教:stock ticker name 转换成 integer ID (转载)
Import a text file into Oracle...问一个SQL LOADER BLOB的问题
how to remove oracle completelyEBCDIC 格式文件怎么转成ASCII格式?谢谢
请问关于tpc-H生成的data读取问题,数据库的大侠们帮帮忙啊!Is Oracle ODBC support batch SQL(PL/SQL procedure)?
请教把access编码由unicode换成ascii的方法how to query chinese in mysql?
remove special characterQuestion about ADO's Recordset
有没有TSQL和 PL/SQl 或者Teradata sql都熟悉的高手, 麻烦看一下[转载] 有谁试了MySql 4.11中的中文全文搜索功能
相关话题的讨论汇总
话题: file话题: number话题: dos话题: ms话题: msdos
进入Database版参与讨论
1 (共1页)
l******9
发帖数: 579
1
【 以下文字转载自 JobHunting 讨论区 】
发信人: light009 (light009), 信区: JobHunting
标 题: error of couting total line number in txt file on MSDOS
发信站: BBS 未名空间站 (Thu Nov 20 18:34:45 2014, 美东)
I would like to find the total line number of a text file ( > 60 GB) in MS-
DOS.
I used:
findstr /R /N "^" file.txt | find /C ":"
But, the returned result is a negative number.
It is overflow ?
The file have not more than 5 billion lines.
For an integer (4 Bytes), its max range is From −2,147,483,648 to 2,
147,483,647.
So, I need to design a script to count the number by dividing the result
with 1000 ?
If yes, please help me with how to design the script in MS DOS.
Thanks
s**********o
发帖数: 14359
2
MS-DOS跟我们数据没啥关系,你这个还是TEXT FILE
对待这么大的文件,DOS打开文件内存不够吧
l******9
发帖数: 579
3
This file was loaded to netezza database.
But, I need to make sure that the all lines in the file have been loaded to
the database.
So, I need to know how many lines the txt file has so that I can compare it
with the table in database.
I only need to know how many lines the file has, I do not need to open the
file.
Thanks !

【在 s**********o 的大作中提到】
: MS-DOS跟我们数据没啥关系,你这个还是TEXT FILE
: 对待这么大的文件,DOS打开文件内存不够吧

s**********o
发帖数: 14359
4
不打开文件怎么数行啊,而且应该数的是ASCII吧,否则有乱码的会出错
显然你没编过程

to
it

【在 l******9 的大作中提到】
: This file was loaded to netezza database.
: But, I need to make sure that the all lines in the file have been loaded to
: the database.
: So, I need to know how many lines the txt file has so that I can compare it
: with the table in database.
: I only need to know how many lines the file has, I do not need to open the
: file.
: Thanks !

A*******n
发帖数: 625
5
var lineCount = File.ReadAllLines(@"C:\file.txt").Length;
or
var lineCount = 0;
using (var reader = File.OpenText(@"C:\file.txt"))
{
while (reader.ReadLine() != null)
{
lineCount++;
}
}
l******9
发帖数: 579
6
I am not allowed to install .NET and do programing on the server.
I can only access the file remotely. It may take long time for a large file
120 GB to run C# locally to get the line number remotely through network.
thanks !

【在 A*******n 的大作中提到】
: var lineCount = File.ReadAllLines(@"C:\file.txt").Length;
: or
: var lineCount = 0;
: using (var reader = File.OpenText(@"C:\file.txt"))
: {
: while (reader.ReadLine() != null)
: {
: lineCount++;
: }
: }

s**********o
发帖数: 14359
7
说过了DOS内存不够,根本打不开文件,
你要TEST大型BATCH文件,不COPY到LOCAL
根本做不了,无解
1 (共1页)
进入Database版参与讨论
相关主题
[转载] 有谁试了MySql 4.11中的中文全文搜索功能请问关于tpc-H生成的data读取问题,数据库的大侠们帮帮忙啊!
偶想安装oracle请教把access编码由unicode换成ascii的方法
SQL server的一个问题,急问!remove special character
怎样让oracle不要fail on error有没有TSQL和 PL/SQl 或者Teradata sql都熟悉的高手, 麻烦看一下
sql数据库实时更新问题求教:
how to remote access to SQLserver DB?做机问题请教:stock ticker name 转换成 integer ID (转载)
Import a text file into Oracle...问一个SQL LOADER BLOB的问题
how to remove oracle completelyEBCDIC 格式文件怎么转成ASCII格式?谢谢
相关话题的讨论汇总
话题: file话题: number话题: dos话题: ms话题: msdos