Imports with Linefeeds in the data
Mike Schwartz
mschw at athenet.net
Sun Dec 11 11:09:17 PST 2011
> I have a customer that will be sending me orders in a file that has
linefeed
> characters in a particular field in some records. The records are
separated by
> a CR-LF and the LFs are by themselves in one of the fields in some of the
> records. Currently it treats the data separated by the LFs as separate
records
> which messes up the importing.
>
> First, how do I separate the records using IMPORT? Second, can I
> import these so that the linefeeds are included in a field in Filepro?
>
> Thanks in advance,
> Boaz
I'm going to presume that you're running a Unix or Linux version of
filePro, although you don't state that. In this case, it's important to
know which version of filePro you're running and also which operating
system. I don't want to suggest shell scripts and such that might not run
on your particular operating system.
Here are a few quick thoughts:
You might want to consider using filePro's "open" command. "Open"
gives you much better control of incoming files. Then use xlate or some
other code to remove the unwanted statements.
You can pass through your "import" statement more than once, reading
the import file multiple times and concatenating the strings together until
you encounter a "cr" character. Again, use xlate on the strings to remove
the unwanted LF characters. Then process the whole string as one record.
As I mentioned, there are SED and AWK shell scripts that have been
posted on this list that probably will remove the stray LF's, but we need to
know which operating system you're running.
In addition to letting us know which operating system you're using, it
would help if you could cut and paste the specific import line you're trying
to use.
Hope that helps. If not, please send us more info.
Mike Schwartz
More information about the Filepro-list
mailing list