Reading from a text file and printing the words character by character at a time

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
5
down vote

favorite












I would like to write a program that reads from a text file and prints in Terminal the words of that file character by character every one second.



For example, in a text file log.txt let's say I have this sentence:



I love Unix but I don't know programming.


I would like the code to read the previous sentence and print the letters, the spaces one by one every second.










share|improve this question









New contributor




Zahi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    5
    down vote

    favorite












    I would like to write a program that reads from a text file and prints in Terminal the words of that file character by character every one second.



    For example, in a text file log.txt let's say I have this sentence:



    I love Unix but I don't know programming.


    I would like the code to read the previous sentence and print the letters, the spaces one by one every second.










    share|improve this question









    New contributor




    Zahi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      5
      down vote

      favorite









      up vote
      5
      down vote

      favorite











      I would like to write a program that reads from a text file and prints in Terminal the words of that file character by character every one second.



      For example, in a text file log.txt let's say I have this sentence:



      I love Unix but I don't know programming.


      I would like the code to read the previous sentence and print the letters, the spaces one by one every second.










      share|improve this question









      New contributor




      Zahi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I would like to write a program that reads from a text file and prints in Terminal the words of that file character by character every one second.



      For example, in a text file log.txt let's say I have this sentence:



      I love Unix but I don't know programming.


      I would like the code to read the previous sentence and print the letters, the spaces one by one every second.







      shell text-processing






      share|improve this question









      New contributor




      Zahi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Zahi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited Sep 8 at 21:15









      don_crissti

      47k15124154




      47k15124154






      New contributor




      Zahi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Sep 8 at 20:07









      Zahi

      636




      636




      New contributor




      Zahi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Zahi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Zahi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          5 Answers
          5






          active

          oldest

          votes

















          up vote
          6
          down vote



          accepted










          You can do this



          var=$(cat log.txt)
          for (( i=0; i<$#var; i++ )); do
          sleep 1 | echo -ne "$var:$i:1"
          done
          echo ""





          share|improve this answer






















          • thk for quick answr. this is wht i want but why it priunt on the same line ike this `I love Unix but I don't know programming.[zahi@sonar]$, how print on separate line?
            – Zahi
            Sep 8 at 20:30











          • Ah, please see my revisions
            – Goro
            Sep 8 at 20:32











          • thank you very much
            – Zahi
            Sep 8 at 20:34

















          up vote
          9
          down vote













          Goro's answer will work, but it should be noted that command substitution removes trailing newlines as specified by POSIX standard. Thus it may not be desirable where you want to actually iterate over all charactes, even non-printable ones. Another issue is that C-style for loop is used in bash and ksh93, but not in standard (aka POSIX-comliant ) /bin/sh. The $variable:index:offset form of parameter expansion is also type of bashism and not specified by POSIX definitions of parameter expansion (though supported by ksh93 and zsh).



          Nonetheless, there's a way to iterate over all characters in file portably and in a far more practical way. That's to use awk:



          # all characters on the same line
          $ awk 'for(i=1;i<=length;i++) printf "%c",substr($0,i,1); system("sleep 1");; print' input.txt

          # all characters on separate lines
          $ awk 'for(i=1;i<=length;i++) print substr($0, i, 1); system("sleep 1"); ' input.txt


          With this command substr() and system() are both specified in POSIX awk and will in fact iterate over all characters.






          share|improve this answer


















          • 1




            @Goro Already added a comment about that, see the edit
            – Sergiy Kolodyazhnyy
            Sep 8 at 21:15






          • 3




            Very elegant!! thanks! ;-)
            – Goro
            Sep 8 at 21:20






          • 2




            @don_crissti I need to find a better phrase than "bashism" because I always get ksh and zsh mentioned. Can we start using something like ba,k,zsh maybe ? :)
            – Sergiy Kolodyazhnyy
            Sep 8 at 21:33






          • 2




            I think just mentioning non-posix or non-standard would do...
            – don_crissti
            Sep 8 at 21:33










          • @don_crissti non-posix adds another level of ambiguity because POSIX mostly was based on ksh and Bourne shell, and bash has --posix flag and supoorts most of the POSIX features. Idk, there's gotta be a better way to phrase it
            – Sergiy Kolodyazhnyy
            Sep 9 at 0:28

















          up vote
          3
          down vote













          With bash or ksh93 you can read single characters using the shell's built-in read command:



          while IFS= read -r -n 1 c; do 
          printf '%c' "$c"
          sleep 1
          done < log.txt
          printf 'n'





          share|improve this answer



























            up vote
            1
            down vote













            Here's a Python solution:



            python -c "from time import sleep
            with open('/tmp/file.txt') as f:
            for line in f:
            for c in line:
            print(c, end='', flush=True);sleep(1);"


            You should just be able to paste that on the command line and change the name of the input file.






            share|improve this answer



























              up vote
              0
              down vote













              You could do this with Perl as shown:



              perl -pe 'BEGIN=1; sleep 1' log.txt



              • -p will autoprint the current record before fetching the next.


              • $/=1 will make perl read the input stream a byte at a time, and assuming the characters are a byte sized.


              • $|=1 will output is buffered.





              share|improve this answer




















                Your Answer







                StackExchange.ready(function()
                var channelOptions =
                tags: "".split(" "),
                id: "106"
                ;
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function()
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled)
                StackExchange.using("snippets", function()
                createEditor();
                );

                else
                createEditor();

                );

                function createEditor()
                StackExchange.prepareEditor(
                heartbeatType: 'answer',
                convertImagesToLinks: false,
                noModals: false,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: null,
                bindNavPrevention: true,
                postfix: "",
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                );



                );






                Zahi is a new contributor. Be nice, and check out our Code of Conduct.









                 

                draft saved


                draft discarded


















                StackExchange.ready(
                function ()
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f467767%2freading-from-a-text-file-and-printing-the-words-character-by-character-at-a-time%23new-answer', 'question_page');

                );

                Post as a guest






























                5 Answers
                5






                active

                oldest

                votes








                5 Answers
                5






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes








                up vote
                6
                down vote



                accepted










                You can do this



                var=$(cat log.txt)
                for (( i=0; i<$#var; i++ )); do
                sleep 1 | echo -ne "$var:$i:1"
                done
                echo ""





                share|improve this answer






















                • thk for quick answr. this is wht i want but why it priunt on the same line ike this `I love Unix but I don't know programming.[zahi@sonar]$, how print on separate line?
                  – Zahi
                  Sep 8 at 20:30











                • Ah, please see my revisions
                  – Goro
                  Sep 8 at 20:32











                • thank you very much
                  – Zahi
                  Sep 8 at 20:34














                up vote
                6
                down vote



                accepted










                You can do this



                var=$(cat log.txt)
                for (( i=0; i<$#var; i++ )); do
                sleep 1 | echo -ne "$var:$i:1"
                done
                echo ""





                share|improve this answer






















                • thk for quick answr. this is wht i want but why it priunt on the same line ike this `I love Unix but I don't know programming.[zahi@sonar]$, how print on separate line?
                  – Zahi
                  Sep 8 at 20:30











                • Ah, please see my revisions
                  – Goro
                  Sep 8 at 20:32











                • thank you very much
                  – Zahi
                  Sep 8 at 20:34












                up vote
                6
                down vote



                accepted







                up vote
                6
                down vote



                accepted






                You can do this



                var=$(cat log.txt)
                for (( i=0; i<$#var; i++ )); do
                sleep 1 | echo -ne "$var:$i:1"
                done
                echo ""





                share|improve this answer














                You can do this



                var=$(cat log.txt)
                for (( i=0; i<$#var; i++ )); do
                sleep 1 | echo -ne "$var:$i:1"
                done
                echo ""






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Sep 8 at 21:08

























                answered Sep 8 at 20:10









                Goro

                1,40641643




                1,40641643











                • thk for quick answr. this is wht i want but why it priunt on the same line ike this `I love Unix but I don't know programming.[zahi@sonar]$, how print on separate line?
                  – Zahi
                  Sep 8 at 20:30











                • Ah, please see my revisions
                  – Goro
                  Sep 8 at 20:32











                • thank you very much
                  – Zahi
                  Sep 8 at 20:34
















                • thk for quick answr. this is wht i want but why it priunt on the same line ike this `I love Unix but I don't know programming.[zahi@sonar]$, how print on separate line?
                  – Zahi
                  Sep 8 at 20:30











                • Ah, please see my revisions
                  – Goro
                  Sep 8 at 20:32











                • thank you very much
                  – Zahi
                  Sep 8 at 20:34















                thk for quick answr. this is wht i want but why it priunt on the same line ike this `I love Unix but I don't know programming.[zahi@sonar]$, how print on separate line?
                – Zahi
                Sep 8 at 20:30





                thk for quick answr. this is wht i want but why it priunt on the same line ike this `I love Unix but I don't know programming.[zahi@sonar]$, how print on separate line?
                – Zahi
                Sep 8 at 20:30













                Ah, please see my revisions
                – Goro
                Sep 8 at 20:32





                Ah, please see my revisions
                – Goro
                Sep 8 at 20:32













                thank you very much
                – Zahi
                Sep 8 at 20:34




                thank you very much
                – Zahi
                Sep 8 at 20:34












                up vote
                9
                down vote













                Goro's answer will work, but it should be noted that command substitution removes trailing newlines as specified by POSIX standard. Thus it may not be desirable where you want to actually iterate over all charactes, even non-printable ones. Another issue is that C-style for loop is used in bash and ksh93, but not in standard (aka POSIX-comliant ) /bin/sh. The $variable:index:offset form of parameter expansion is also type of bashism and not specified by POSIX definitions of parameter expansion (though supported by ksh93 and zsh).



                Nonetheless, there's a way to iterate over all characters in file portably and in a far more practical way. That's to use awk:



                # all characters on the same line
                $ awk 'for(i=1;i<=length;i++) printf "%c",substr($0,i,1); system("sleep 1");; print' input.txt

                # all characters on separate lines
                $ awk 'for(i=1;i<=length;i++) print substr($0, i, 1); system("sleep 1"); ' input.txt


                With this command substr() and system() are both specified in POSIX awk and will in fact iterate over all characters.






                share|improve this answer


















                • 1




                  @Goro Already added a comment about that, see the edit
                  – Sergiy Kolodyazhnyy
                  Sep 8 at 21:15






                • 3




                  Very elegant!! thanks! ;-)
                  – Goro
                  Sep 8 at 21:20






                • 2




                  @don_crissti I need to find a better phrase than "bashism" because I always get ksh and zsh mentioned. Can we start using something like ba,k,zsh maybe ? :)
                  – Sergiy Kolodyazhnyy
                  Sep 8 at 21:33






                • 2




                  I think just mentioning non-posix or non-standard would do...
                  – don_crissti
                  Sep 8 at 21:33










                • @don_crissti non-posix adds another level of ambiguity because POSIX mostly was based on ksh and Bourne shell, and bash has --posix flag and supoorts most of the POSIX features. Idk, there's gotta be a better way to phrase it
                  – Sergiy Kolodyazhnyy
                  Sep 9 at 0:28














                up vote
                9
                down vote













                Goro's answer will work, but it should be noted that command substitution removes trailing newlines as specified by POSIX standard. Thus it may not be desirable where you want to actually iterate over all charactes, even non-printable ones. Another issue is that C-style for loop is used in bash and ksh93, but not in standard (aka POSIX-comliant ) /bin/sh. The $variable:index:offset form of parameter expansion is also type of bashism and not specified by POSIX definitions of parameter expansion (though supported by ksh93 and zsh).



                Nonetheless, there's a way to iterate over all characters in file portably and in a far more practical way. That's to use awk:



                # all characters on the same line
                $ awk 'for(i=1;i<=length;i++) printf "%c",substr($0,i,1); system("sleep 1");; print' input.txt

                # all characters on separate lines
                $ awk 'for(i=1;i<=length;i++) print substr($0, i, 1); system("sleep 1"); ' input.txt


                With this command substr() and system() are both specified in POSIX awk and will in fact iterate over all characters.






                share|improve this answer


















                • 1




                  @Goro Already added a comment about that, see the edit
                  – Sergiy Kolodyazhnyy
                  Sep 8 at 21:15






                • 3




                  Very elegant!! thanks! ;-)
                  – Goro
                  Sep 8 at 21:20






                • 2




                  @don_crissti I need to find a better phrase than "bashism" because I always get ksh and zsh mentioned. Can we start using something like ba,k,zsh maybe ? :)
                  – Sergiy Kolodyazhnyy
                  Sep 8 at 21:33






                • 2




                  I think just mentioning non-posix or non-standard would do...
                  – don_crissti
                  Sep 8 at 21:33










                • @don_crissti non-posix adds another level of ambiguity because POSIX mostly was based on ksh and Bourne shell, and bash has --posix flag and supoorts most of the POSIX features. Idk, there's gotta be a better way to phrase it
                  – Sergiy Kolodyazhnyy
                  Sep 9 at 0:28












                up vote
                9
                down vote










                up vote
                9
                down vote









                Goro's answer will work, but it should be noted that command substitution removes trailing newlines as specified by POSIX standard. Thus it may not be desirable where you want to actually iterate over all charactes, even non-printable ones. Another issue is that C-style for loop is used in bash and ksh93, but not in standard (aka POSIX-comliant ) /bin/sh. The $variable:index:offset form of parameter expansion is also type of bashism and not specified by POSIX definitions of parameter expansion (though supported by ksh93 and zsh).



                Nonetheless, there's a way to iterate over all characters in file portably and in a far more practical way. That's to use awk:



                # all characters on the same line
                $ awk 'for(i=1;i<=length;i++) printf "%c",substr($0,i,1); system("sleep 1");; print' input.txt

                # all characters on separate lines
                $ awk 'for(i=1;i<=length;i++) print substr($0, i, 1); system("sleep 1"); ' input.txt


                With this command substr() and system() are both specified in POSIX awk and will in fact iterate over all characters.






                share|improve this answer














                Goro's answer will work, but it should be noted that command substitution removes trailing newlines as specified by POSIX standard. Thus it may not be desirable where you want to actually iterate over all charactes, even non-printable ones. Another issue is that C-style for loop is used in bash and ksh93, but not in standard (aka POSIX-comliant ) /bin/sh. The $variable:index:offset form of parameter expansion is also type of bashism and not specified by POSIX definitions of parameter expansion (though supported by ksh93 and zsh).



                Nonetheless, there's a way to iterate over all characters in file portably and in a far more practical way. That's to use awk:



                # all characters on the same line
                $ awk 'for(i=1;i<=length;i++) printf "%c",substr($0,i,1); system("sleep 1");; print' input.txt

                # all characters on separate lines
                $ awk 'for(i=1;i<=length;i++) print substr($0, i, 1); system("sleep 1"); ' input.txt


                With this command substr() and system() are both specified in POSIX awk and will in fact iterate over all characters.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Sep 8 at 21:33

























                answered Sep 8 at 21:12









                Sergiy Kolodyazhnyy

                7,92011648




                7,92011648







                • 1




                  @Goro Already added a comment about that, see the edit
                  – Sergiy Kolodyazhnyy
                  Sep 8 at 21:15






                • 3




                  Very elegant!! thanks! ;-)
                  – Goro
                  Sep 8 at 21:20






                • 2




                  @don_crissti I need to find a better phrase than "bashism" because I always get ksh and zsh mentioned. Can we start using something like ba,k,zsh maybe ? :)
                  – Sergiy Kolodyazhnyy
                  Sep 8 at 21:33






                • 2




                  I think just mentioning non-posix or non-standard would do...
                  – don_crissti
                  Sep 8 at 21:33










                • @don_crissti non-posix adds another level of ambiguity because POSIX mostly was based on ksh and Bourne shell, and bash has --posix flag and supoorts most of the POSIX features. Idk, there's gotta be a better way to phrase it
                  – Sergiy Kolodyazhnyy
                  Sep 9 at 0:28












                • 1




                  @Goro Already added a comment about that, see the edit
                  – Sergiy Kolodyazhnyy
                  Sep 8 at 21:15






                • 3




                  Very elegant!! thanks! ;-)
                  – Goro
                  Sep 8 at 21:20






                • 2




                  @don_crissti I need to find a better phrase than "bashism" because I always get ksh and zsh mentioned. Can we start using something like ba,k,zsh maybe ? :)
                  – Sergiy Kolodyazhnyy
                  Sep 8 at 21:33






                • 2




                  I think just mentioning non-posix or non-standard would do...
                  – don_crissti
                  Sep 8 at 21:33










                • @don_crissti non-posix adds another level of ambiguity because POSIX mostly was based on ksh and Bourne shell, and bash has --posix flag and supoorts most of the POSIX features. Idk, there's gotta be a better way to phrase it
                  – Sergiy Kolodyazhnyy
                  Sep 9 at 0:28







                1




                1




                @Goro Already added a comment about that, see the edit
                – Sergiy Kolodyazhnyy
                Sep 8 at 21:15




                @Goro Already added a comment about that, see the edit
                – Sergiy Kolodyazhnyy
                Sep 8 at 21:15




                3




                3




                Very elegant!! thanks! ;-)
                – Goro
                Sep 8 at 21:20




                Very elegant!! thanks! ;-)
                – Goro
                Sep 8 at 21:20




                2




                2




                @don_crissti I need to find a better phrase than "bashism" because I always get ksh and zsh mentioned. Can we start using something like ba,k,zsh maybe ? :)
                – Sergiy Kolodyazhnyy
                Sep 8 at 21:33




                @don_crissti I need to find a better phrase than "bashism" because I always get ksh and zsh mentioned. Can we start using something like ba,k,zsh maybe ? :)
                – Sergiy Kolodyazhnyy
                Sep 8 at 21:33




                2




                2




                I think just mentioning non-posix or non-standard would do...
                – don_crissti
                Sep 8 at 21:33




                I think just mentioning non-posix or non-standard would do...
                – don_crissti
                Sep 8 at 21:33












                @don_crissti non-posix adds another level of ambiguity because POSIX mostly was based on ksh and Bourne shell, and bash has --posix flag and supoorts most of the POSIX features. Idk, there's gotta be a better way to phrase it
                – Sergiy Kolodyazhnyy
                Sep 9 at 0:28




                @don_crissti non-posix adds another level of ambiguity because POSIX mostly was based on ksh and Bourne shell, and bash has --posix flag and supoorts most of the POSIX features. Idk, there's gotta be a better way to phrase it
                – Sergiy Kolodyazhnyy
                Sep 9 at 0:28










                up vote
                3
                down vote













                With bash or ksh93 you can read single characters using the shell's built-in read command:



                while IFS= read -r -n 1 c; do 
                printf '%c' "$c"
                sleep 1
                done < log.txt
                printf 'n'





                share|improve this answer
























                  up vote
                  3
                  down vote













                  With bash or ksh93 you can read single characters using the shell's built-in read command:



                  while IFS= read -r -n 1 c; do 
                  printf '%c' "$c"
                  sleep 1
                  done < log.txt
                  printf 'n'





                  share|improve this answer






















                    up vote
                    3
                    down vote










                    up vote
                    3
                    down vote









                    With bash or ksh93 you can read single characters using the shell's built-in read command:



                    while IFS= read -r -n 1 c; do 
                    printf '%c' "$c"
                    sleep 1
                    done < log.txt
                    printf 'n'





                    share|improve this answer












                    With bash or ksh93 you can read single characters using the shell's built-in read command:



                    while IFS= read -r -n 1 c; do 
                    printf '%c' "$c"
                    sleep 1
                    done < log.txt
                    printf 'n'






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Sep 8 at 22:46









                    steeldriver

                    32.1k34979




                    32.1k34979




















                        up vote
                        1
                        down vote













                        Here's a Python solution:



                        python -c "from time import sleep
                        with open('/tmp/file.txt') as f:
                        for line in f:
                        for c in line:
                        print(c, end='', flush=True);sleep(1);"


                        You should just be able to paste that on the command line and change the name of the input file.






                        share|improve this answer
























                          up vote
                          1
                          down vote













                          Here's a Python solution:



                          python -c "from time import sleep
                          with open('/tmp/file.txt') as f:
                          for line in f:
                          for c in line:
                          print(c, end='', flush=True);sleep(1);"


                          You should just be able to paste that on the command line and change the name of the input file.






                          share|improve this answer






















                            up vote
                            1
                            down vote










                            up vote
                            1
                            down vote









                            Here's a Python solution:



                            python -c "from time import sleep
                            with open('/tmp/file.txt') as f:
                            for line in f:
                            for c in line:
                            print(c, end='', flush=True);sleep(1);"


                            You should just be able to paste that on the command line and change the name of the input file.






                            share|improve this answer












                            Here's a Python solution:



                            python -c "from time import sleep
                            with open('/tmp/file.txt') as f:
                            for line in f:
                            for c in line:
                            print(c, end='', flush=True);sleep(1);"


                            You should just be able to paste that on the command line and change the name of the input file.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Sep 9 at 3:32









                            user1717828

                            1,60611125




                            1,60611125




















                                up vote
                                0
                                down vote













                                You could do this with Perl as shown:



                                perl -pe 'BEGIN=1; sleep 1' log.txt



                                • -p will autoprint the current record before fetching the next.


                                • $/=1 will make perl read the input stream a byte at a time, and assuming the characters are a byte sized.


                                • $|=1 will output is buffered.





                                share|improve this answer
























                                  up vote
                                  0
                                  down vote













                                  You could do this with Perl as shown:



                                  perl -pe 'BEGIN=1; sleep 1' log.txt



                                  • -p will autoprint the current record before fetching the next.


                                  • $/=1 will make perl read the input stream a byte at a time, and assuming the characters are a byte sized.


                                  • $|=1 will output is buffered.





                                  share|improve this answer






















                                    up vote
                                    0
                                    down vote










                                    up vote
                                    0
                                    down vote









                                    You could do this with Perl as shown:



                                    perl -pe 'BEGIN=1; sleep 1' log.txt



                                    • -p will autoprint the current record before fetching the next.


                                    • $/=1 will make perl read the input stream a byte at a time, and assuming the characters are a byte sized.


                                    • $|=1 will output is buffered.





                                    share|improve this answer












                                    You could do this with Perl as shown:



                                    perl -pe 'BEGIN=1; sleep 1' log.txt



                                    • -p will autoprint the current record before fetching the next.


                                    • $/=1 will make perl read the input stream a byte at a time, and assuming the characters are a byte sized.


                                    • $|=1 will output is buffered.






                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered 2 days ago









                                    Rakesh Sharma

                                    53013




                                    53013




















                                        Zahi is a new contributor. Be nice, and check out our Code of Conduct.









                                         

                                        draft saved


                                        draft discarded


















                                        Zahi is a new contributor. Be nice, and check out our Code of Conduct.












                                        Zahi is a new contributor. Be nice, and check out our Code of Conduct.











                                        Zahi is a new contributor. Be nice, and check out our Code of Conduct.













                                         


                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function ()
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f467767%2freading-from-a-text-file-and-printing-the-words-character-by-character-at-a-time%23new-answer', 'question_page');

                                        );

                                        Post as a guest













































































                                        Comments

                                        Popular posts from this blog

                                        What does second last employer means? [closed]

                                        List of Gilmore Girls characters

                                        Confectionery