Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Tool to count number bytes in each lines of file

  • 02-05-2000 04:23PM
    #1
    Registered Users, Registered Users 2 Posts: 16,415 ✭✭✭✭


    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,415 ✭✭✭✭Trojan


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


Advertisement