in reply to Regular Expression help, MS Access Pipe delimited export gone bad

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

  • Comment on Re: Regular Expression help, MS Access Pipe delimited export gone bad
  • Download Code