Hello,
I am trying to split an array of strings so that each row of the string array is split into individual elements.
a = ["MARZ M AA1 R Z";
"MARZAN M AA1 R a = Z AH0 N";
"MARZANO M AA0 R Z AA1 N OW2";
"MARZEC M AA1 R Z IH0 K";
"MARZETTE M AA2 R Z EH1 T";
"MARZILLI M AA0 R Z IY1 L IY2";
"MARZO M AA1 R Z OW2";
"MARZOLF M AA1 R Z OW2 L F"]
I’ve tried this:
for i in a
push!(a,split(i))
end
but I get this error:
ERROR: MethodError: Cannot `convert` an object of type Array{SubString{String},1} to an object of type String
This may have arisen from a call to the constructor String(...),
since type constructors fall back to convert methods.
Here’s some python code that parses this type of data. Perhaps you can get some inspiration from that, since you can implement it quite similarly in Julia.