Work ! THanks !
"deprecated" Parse Line Working but New Method Parse String from List not working - Bug?
-
So im trying to parse lines from a database but having issues with the way BAS is parsing the data
Database has 3 fields all String - title, url, comment
I can get the data from the DB by using "Create List"
The BasDatabase creates a " : " separated Array but in a strange format without closing Quotes for each string elementNEW_F_LIST: [ "apples:"https://en.wikipedia.org/wiki/Apple":juicy apples:6125da4fc81a72206de82e46" ]I dont understand why BAS does not have closing "" for apples [0] and juicy apples[2]
Shouldnt the correct version using opening " and closing" for each string ...Like this?NEW_F_LIST: [ "apples":"https://en.wikipedia.org/wiki/Apple":"juicy apples":"6125da4fc81a72206de82e46" ]Because of this when i try tp "Parse String" using " : " it parses incorrectly
PARSED_LIST: [ "apples" ""https" "//en.wikipedia.org/wiki/Apple"" "juicy apples" "6125da4fc81a72206de82e46" ]As you see because the "" are not correct it separates the line incorrectly
""https" "//en.wikipedia.org/wiki/Apple""BUT if i use the old Parse Line (deprecated) and create seperate variables for each Element
it works correctlyTOPIC: "apples" URL: "https://en.wikipedia.org/wiki/Apple" KEYWORD: "juicy apples"This isnt making any sense to me =) What am i doing wrong?
Also does using Parse Line (deprecated) mean that it will get detected easier if i use that method? or just not work properly?
-
@boozer said in "deprecated" Parse Line Working but New Method Parse String from List not working - Bug?:
I can get the data from the DB by using "Create List"
DB is resource, so use "Resource To List" action to get it
into a list variable. Dont mix "string" and "list line", its 2
different things.Your DB data contains ":" and you probably mis-using
something, maybe your data in DB is ACTUALLY in JSON
format which uses pairs of data elements separated -
defined by ":" and you are using same separator for list parsing.
Opening an closing quotes in your first code sample just define
line from database and what is inside is one line from database
record, So if you delete first and last quotes you will see that nothing
is missing there, it just confuses you, and you misuse it. Action
parse line works correctly because it threats that data as""line" and
not "string".