Jump to content

How to find the number of chars in a file?


Recommended Posts

Hi,

I need to know how much chars are in a file,it could be any file possible.

I tryed to FileRead then StringLen,but it just gives the first lines of a file.

Is there a possibility with FileGetSize,then to calculate the amount of chars with the size in bytes?

thanx

Link to comment
Share on other sites

  • Developers

Hi,

I need to know how much chars are in a file,it could be any file possible.

I tryed to FileRead then StringLen,but it just gives the first lines of a file.

Is there a possibility with FileGetSize,then to calculate the amount of chars with the size in bytes?

thanx

FileGetSize() returns the numbers of bytes of a file Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

yes I know.Is each character equal to a certain amount of bytes?

StringLen(FileRead($File)) doesn't work for you?

Or if you're using 3.1.1

StringLen(FileRead($File), FileGetSize($File))?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Developers

yes I know.Is each character equal to a certain amount of bytes?

When i went to school 1 character was 1 byte... don't think it changed unless you use Unicode which uses 2 bytes for each character.

:P

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...