- #1
hodei_cloud
- 19
- 0
Hello everyone,
I am making an RSA algorithm (cryptography) with my little knowledge and I am having serious problems with the reading of the text.
I am making it with a simple text reading (no raw format) and the main problem is the length of each line.
For example in this text:
___________________________________
Hello world, I'm doing a text to show you
an easy example
___________________________________
the first line has 42 characters, the second 0 and the third 16.
What I normally do it's making all the lines of length 42 for example (m=42) and read it with a string per line or with a matrix (character type).
Like this
But the problems is that the matrix has a lot of "spaces" characters that I don't want to read! (the right spaces, no all the spaces)
I am trying to do like a matrix with a "flexible" length or something (dont know if exists) to read each line exactly
If you can't help me this way, can you help me with a good link to learn how the raw read/write works? (i suppose that this would help me, maybe I'm wrong too)
I am making an RSA algorithm (cryptography) with my little knowledge and I am having serious problems with the reading of the text.
I am making it with a simple text reading (no raw format) and the main problem is the length of each line.
For example in this text:
___________________________________
Hello world, I'm doing a text to show you
an easy example
___________________________________
the first line has 42 characters, the second 0 and the third 16.
What I normally do it's making all the lines of length 42 for example (m=42) and read it with a string per line or with a matrix (character type).
Like this
Code:
do i=1,n !n-->lines,(i know how to read all the lines but no the lenght)
read(unit="whatever",fmt="(42a1)"),(x(i,j),j=1,m)
enddo
I am trying to do like a matrix with a "flexible" length or something (dont know if exists) to read each line exactly
If you can't help me this way, can you help me with a good link to learn how the raw read/write works? (i suppose that this would help me, maybe I'm wrong too)