If I have the following data in txt, how can I read the number 100?

100    # the number 100

If it’s just a raw string, try parse(Int, split(str)[1]).
If it’s in a file, use parse(Int, readuntil("filename.txt", '#'))

readdlm is a good general solution for this sort of application: readdlm("filename.txt")[1]

1 Like
thank u very much!!!