March 27, 20223 yr Newbies I am trying to import a csv file and parse it into an fmp table on fmp go 19. The import and parsing are working well on a pc. On my ipad, I am able to import the csv file, but the parsing is creating a blank record for every record parsed. I suspect it is due to the effort to replace the ipad line feed character with a character return. My code is # Replace windows CRLF If [ PatternCount ( Import CSV::Text ; Char ( 13 ) & Char ( 10 ) ) ] Set Field [ Import CSV::Text; Substitute ( Import CSV::Text ; Char ( 13 ) & Char ( 10 ) ; "¶" ) ] End If #Replace iOS Unix (LF) If [ PatternCount ( GetAsText ( Import CSV::Text ) ; Char ( 10 ) )] Set Field [ Import CSV::Text; Substitute ( Import CSV::Text ; Char ( 10 ) ; "¶" ) ] End If Also, what is the ipad based file path format, how many slashes following file:, I have seen several different formats based on which version of FM go. Thanks Ron
March 28, 20223 yr We don't see the actual file, and we don't see how exactly you parse it - so this is pure guesswork. I would guess that if you're getting blank records, then you have blank lines in the source. You can test for this by looking at ValueCount ( Import CSV::Text ) and PatternCount ( Import CSV::Text ; "¶¶" ). BTW, there is no need to test for the presence of a pattern before substituting it. If the pattern doesn't occur, Substitute() will not do anything. And I would use a variable as the target instead of the original field.
Create an account or sign in to comment