Page 1 of 1

Count the rows in sequential/Complex file

Posted: Mon Mar 29, 2010 12:01 pm
by ms294
Does anybody know how to count the total number of row/records in a sequential or complex flat file using dataStage 7.5 ? Thanks!

mark

Posted: Mon Mar 29, 2010 12:49 pm
by anbu
Use aggregator and do count on any non-nullable field to get the row count

Posted: Mon Mar 29, 2010 5:42 pm
by chulett
That's certainly one way, it might be helpful to know how you need to use this count to see if there is a "better" way.

Posted: Tue Mar 30, 2010 2:35 am
by Sainath.Srinivasan
For a sequential file with newline delimiter, a simple wc in unix and find in dos can get your answer.

For non-newline (but delimited) file, you can either locate those delimiters.

For fixed width, divide the file size by record length.

Posted: Tue Mar 30, 2010 3:24 am
by adisheshu.dwh
in Unix u can use WC ,It can count total num of characters ,rows and num of lines and words

wc -c filename................count the characters
wc -l filename................count the num of lines
wc -w filename..............count the num of words

Posted: Tue Mar 30, 2010 4:15 am
by ray.wurlod
U (one of our other posters) did not ask the question, so why did you suggest that U could use the WC command?

That wouldn't work anyway. UNIX commands are case sensitive, and the correct command name in this case would be wc.

The second person personal pronoun in English is spelled "you". Try to maintain a professional standard of written English on DSXchange - it helps those whose first language is not English.

Posted: Tue Mar 30, 2010 3:04 pm
by ms294
anbu wrote:Use aggregator and do count on any non-nullable field to get the row count
This did solve my problem. Thanks !