Sign in to follow this  
Followers 0
clearguy

How to find the number of chars in a file?

7 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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))?


[center]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.[/center]

Share this post


Link to post
Share on other sites

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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  
Followers 0