Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Tool to count number bytes in each lines of file

  • 02-05-2000 3:23pm
    #1
    Registered Users, Registered Users 2 Posts: 16,414 ✭✭✭✭


    Lo All,

    I'm looking for a tool to tell me if any of the text files in a certain directory have lines longer than 80 bytes, and if so how many etc.

    Anyone tell me where to start looking? Can I do it with a unix tool like grep or something?

    Cheers,
    Al.


Comments

  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    In Qbasic...
    const filename = "textfile.txt"
    
    open filename for input as #1
    open "report.txt" output as #2
    do while not eof(1)
     linenumber = linenumber + 1
     line input #1, a$
     length = len(a$)
     if length > 80 then 
       print #2, linenumber; " :"; length
     end if
    loop
    reset
    
    



  • Registered Users, Registered Users 2 Posts: 16,414 ✭✭✭✭Trojan


    Cheers,
    you made life a bit easier for me.
    Al.


Advertisement