Student Support Forum
-----
Student Support Forum: 'reading from file' topicStudent Support Forum > General > Archives > "reading from file"

< Previous CommentHelp | Reply To Comment | Reply To Topic | Post New Topic
Author Comment/Response
yehuda ben-shimol
05/17/08 1:25pm

In Response To 'Re: reading from file'
---------
Certainly not a bug. You missed the point.
My previous answer directed you to read the numbers as strings, so zeros would appear as characters.
You still insisted to read the file content as a list of numbers, and for that case there is no point of keeping leading zeros.

Anyway, if these leading zeros are the problem at hand, you can read the file as numbers, and then use the function IntegerDigits with the correct base and length parameters

for example

IntegerDigits[
ReadList["C:\\number1.txt", Number, RecordLists -> False], 2, 9]

yehuda


URL: ,

Subject (listing for 'reading from file')
Author Date Posted
reading from file alireza 05/11/08 2:42pm
Re: reading from file yehuda ben-s... 05/13/08 4:16pm
Re: reading from file Forum Modera... 05/14/08 06:49am
Re: reading from file alireza 05/14/08 11:38am
Re: Re: reading from file yehuda ben-s... 05/17/08 1:25pm
< Previous CommentHelp | Reply To Comment | Reply To Topic | Post New Topic





 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy