if you’re just counting the number of “entry” (defined by starting with a date) in that file, you can use a regular expressing to match the dates as r"^\d{2}/\d{2}/\d{4}":
julia> open("test.txt") do f
line = 0
while !eof(f)
s = readline(f)
if occursin(r"^\d{2}/\d{2}/\d{4}", s)
line += 1
println(s)
end
end
println(line)
end
06/22/2021 {somenthing}
06/22/2021 {somenthing}
06/22/2021 {somenthing so long that goes
06/22/2021 {somenthing}
4
Thanks. IÄşl try as soon as i get home. I am not counting the number of entry. I need to parse this file and i need each line starting with a date otherwise my code fails.
this is fine, you just need to modify the code such that you treat nextline as the same line until you hit a line that starts with a date, just need to modify the loop a bit.