p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access VBA (http://p2p.wrox.com/forumdisplay.php?f=80)
-   -   Need to Count number of lines in a file (http://p2p.wrox.com/showthread.php?t=60181)

lawsoncobol July 17th, 2007 04:30 AM

Need to Count number of lines in a file
 
Hi Friends

   i need little help


Actually i have 2 or 3 files in a folder and i want to count the number of lines present in the files and show it on screen

File path

C:\c\123PD
C:\c\123WS
C:\c\123.rpt
C:\c\45PD
C:\c\45WS
C:\c\45.rpt
I want to open them ( note : i want to open all files which has PD as extension then get the first 3 char ( may be 2 or 3 digit) of PD file , like in example it would be 123 then get all the file starting with 123 like 123WS and 123.rpt then show me the number of lines present in File ( 123PD ) and File (123WS) and (123.rpt) on screen at one time )

then i will want to referesh the database table and read next set of file which is 45

the common identifier will be there will one PD one WS file present in the path always

Screen may have output field like

File PD - Show = 123PD
Number of lines = 6783

File WS - Show = 123WS
Number of lines = 73

File rpt - show = 123.rpt
Number of lines = 78

database table would be
table 1

Key would be

Line number = number (primary key ) ( value doesnt matter )
FilePD
NumberoflinesPD
FileWS
NumberoflinesWS
Filerpt
Numberoflinesrpt

the count variables names should be different for three different files


Thanks and Regards
Lawson, COBOL

mmcdonal July 18th, 2007 06:45 AM

What kind of files are these? Are they .txt, .csv, etc?

What app is the .rpt extension for?

mmcdonal

lawsoncobol July 19th, 2007 04:28 AM

these are cobol files with no extensions but it can renamed to txt files , if VBA can read without extension then really it would be fine
it contains text characters


Thanks and Regards
Lawson, COBOL


All times are GMT -4. The time now is 07:25 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.