Hi,
I want to parse a multi line text field with sample data below to a string array, how do i do this with jjupin sil?
I think i just need to replace the new_line with a comma and that it.
Text Field
One , One
Two , Two
Three , Three
expected output
String [] str
str = "One,One,Two,Two,Three,Three"
Thanks,
eric
Hi Eric,
You can use http://confluence.kepler-rominfo.com/display/SIL/replaceto replace all \n and "," (comma) characters with a "|" (pipe) then cast the resulting string to a string[].
Example:
string s = TEST-123.description; // text to parse s = replace(s, "\n", "|"); s = replace(s, ",", "|"); string [] array = s;
just what i need.
thanks florin..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And would you have a tip how to, while splitting the string based on commas, to ignore the commas inside double quotes?
Many systems when they export to CSV will put columns that contain commas into quotes. E.g.
column1, column2, column3, "column4,test",column5
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.