Read a text file and output ASCII values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neerajmca2007
    New Member
    • Sep 2007
    • 6

    Read a text file and output ASCII values

    hi,
    anybody can tell me that how can i read a text file and then convert it in to ascii value
    thanks in advance
    bye
  • Meetee
    Recognized Expert Contributor
    • Dec 2006
    • 928

    #2
    Originally posted by neerajmca2007
    hi,
    anybody can tell me that how can i read a text file and then convert it in to ascii value
    thanks in advance
    bye
    Hi,

    You can take character by character of the text file string and then can convert it into ASCII by int(str[a]) where a will be a number of letter which is of length of string. You can use for loop for that.

    Hope this helps.

    Regards

    Comment

    • gnanapoongothai
      New Member
      • Jun 2007
      • 62

      #3
      if u wan t to print just the format to %d then u will get the ascii value of characters.

      Comment

      Working...