Perl Monk, Perl Meditation | |
PerlMonks |
Re: Regular Expression help, MS Access Pipe delimited export gone badby jlongino (Parson) |
on Nov 06, 2001 at 12:05 UTC ( [id://123535]=note: print w/replies, xml ) | Need Help?? |
I use MS Access for importing/exporting files all the time
and can tell you that in all likelihood the problem is not
with Access per se. More likely is that whoever designed
the application allowed users to embed hard returns into
text fields (not necessarily a bad thing, depending on what
they were doing with the data). This is common in memo
fields but less so with regular text fields.
The solution is not as simple as looking for a number at the beginning of each line. What if the text that follows the hard return begins with a number? You can't count the number of fields because your records don't end with a delimiter (like 1|abc d|2|xxx|). I think the best solution is to strip the carriage return/line feed pairs out of your Access table text fields before you export the data. Either that or add a field to the end of each Access table and put a fake end-of-record character in it (one that isn't used in the data). Then export and use change the input separator in Perl to the fake character. Not pretty, any way you look at it. Good luck and HTH, --Jim
In Section
Seekers of Perl Wisdom
|
|