I want to get indices in lines corresponding to A=0 in output.
My goal is to get out the data between row index 14 and 23 of the lines variable output in terms of variable i.
for i in 1:length(lines)
try
parse_one(lines[i], Equal("Filter")) == ["Filter"] || continue
catch e
if isa(e,ParserException)
end
else
print(i)
end
end
13
i=13
for x in i:length(lines)
@show A=ncodeunits(lines[x])
end
I donβt know if all the packages you invoked are needed. Iβd do this (and Iβm sure there are even more direct ways to get to the table youβre looking for):
You are wizard. How you got that level of understanding ? Please suggest some resources for me to study. Please also add HTTP package in your answer. Thank You.
Exaggerated: the real βwizardsβ in this forum are others.
My sources are essentially this forum where I randomly follow some topics without any specific interest: just curiosity.
I also bought some books but Iβve never read them (too lazy and unmotivated if I donβt have a specific problem to apply myself to I donβt study the theory).
In this case I made several attempts before arriving at the script I posted. Since Iβve used CSV before, I tried to see if it was applicable in this case too.
In fact, the published idea didnβt satisfy me because first it split the text into various lines and then it had to be rejoined for the part of the table.
I now propose (I also add using HTTP) a different idea that avoids split() and join(). An even more elegant solution could make use of regular expressions to select the part of the text of interest.
The table in the URL in question has fixed column widths. Parsing using separators is less ideal than simply splitting each line at the correct positions.
Finding the correct column ranges for each field automatically is a little trickier. Perhaps the header line, sensing numeric columns could allow it to be done. Maybe regular expressions are the way to go.
If it is a single type of table to be parsed many times, just manually getting the column ranges once and hard-coding them might be a solution.
As I already said: the delimiter is a character so it will most probably not work and proposed to replace four spaces with a comma instead.
Another approach is of course to use a regular expression to remove the brackets and their content, sure.
Otherwise try the approaches by Dan.
But β similar to previous questions you posted β repeating your question does not help.
I read, following the link suggested by @stevengj, that in addition to the βiβ flag there is the βmβ flag which enables the use of β^β as a marker for the beginning of a line.
In the case that you propose a difference between the two occurrences of βfilterβ word it is precisely the fact that the βfilterβ you are looking for is placed at the beginning of a line. There would also be the fact that after the βfilterβ there is a space, but this difference is less βrobustβ, in my opinion.
hb,he=findfirst(r"^Filter"im,txt)
PS
But seeing how the table is formatted, I believe you have many other problems to sort out.
Unless I misinterpret the table (view β.\rawβ), there are several problems to deal with.
One is the header of the fourth field which is on two lines; then there are the missing on lines 1,2 and 5β¦
I donβt know if there is any package that has convenient methods for such cases
PS
Notice that the dataframe has only one column. There is work to do to divide the various pieces.