Lots of replies about the special character. The original data is as follows: (Copied before file was imported in MS-Access) I will also add this isn't for production, just wanting to learn, so in this case I do not care about the character. My guess is the file sent to me came from Excel which is nortorious for adding unwanted characters. Or replacing a "-" with a character.

My text file before import, in MS-Access, and after export looks like

101,Thomasville 104,Tuscaloosa 105,Opelika 108,Tucker 110,Jacksonville 111,Lakeland 112,Miami 113,Villa Rica 114,Lafayette 115,New Orleans 118,Houston 120,Jamestown 124,Lynchburg Bakery 126,Tyler 127,Phoenix 128,Tolleson 129,Fontana 130,Lenexa 133,Modesto 134,Henderson 136,Knoxville 140,Bradenton 147,DKB Bakery 149,Baton Rouge 152,El Paso Bakery 161,Oxford 165,Lepage - Park St 166,Lepage - Cedar St 167,Lepage - Brattleboro 170,San Antonio 180,Bailey Street 181,Goldsboro 184,Norfolk 187,Batesville 188,Denton 190,Leeland 191,Newton 192,Savannah 193,Bardstown 321,Alpine 355,Montgomery 423,Lynchburg DC 430,Bridgeton DC 440,Reynolds DC 447,DKB DC 452,El Paso DC 456,Sacramento 457,Hope Mills 488,Memphis

I will give the regex a try.

2018-01-05 Athanasius removed paragraph tags from data, and added code tags


In reply to Re^2: Replacing a character in a file by Broggy69
in thread Replacing a character in a file by Broggy69

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.