Newbies RonF Posted March 27, 2022 Newbies Posted March 27, 2022 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
comment Posted March 28, 2022 Posted March 28, 2022 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.
Recommended Posts
This topic is 1244 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now