Tech Support Guy banner
Status
Not open for further replies.
1 - 3 of 3 Posts

·
Registered
Joined
·
72 Posts
Discussion Starter · #1 ·
Hi
I have a complex script which outputs a text file for loading to a db.
I now need to enhance this script so that I can issue an ‘lp’ command
to show the count of the number of records in this file.
Can anybody give me the necessary syntax ?
Many thanks in advance !
 

·
Registered
Joined
·
20,583 Posts
Hi grinder182533,

Correct me if I misunderstand your requirements, but lp only prints files, and if by the number of records in a "text file" you actually mean "the number of lines" in the text file, then you can issue the following command to count the number of lines in the file before you enter the text file as a data base entry:
$ cat textfile | wc -l
will count the number of lines in the textfile.

Is the textfile you load into the db actually - one record - in the db? If that is the case, then ignore the above example as it will not give you the number of records in the db. For that you will have to look up the db documentation used by the data base administrator and issue one of the commands related to administering the db to find out that information.

-- Tom
 
1 - 3 of 3 Posts
Status
Not open for further replies.
Top