Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: 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 reply to Re: Regular Expression help, MS Access Pipe delimited export gone bad by jlongino
in thread Regular Expression help, MS Access Pipe delimited export gone bad by silent11

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-25 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found