Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

The output string you shared has a length of 212, which is 40 fewer than the record size of 252--and you have exactly 40 empty fields, i.e., ||, in that string. If you filled each empty field with a character, e.g., an "X", you'd have a 252-byte record. Is this what you want to do? Since the records are | delimited, why does each record need to be 252 bytes?

If you do want to fill all the empty fields with an "X" (or some other character) you can do the following with the string:

$string =~ s/(?<=\|)(?=\|)/X/g;

However, it would be far better to address the data in your variables before creating that string.

My apologies if I've misunderstood your problem.

Update I: Athanasius makes an excellent point about the "|" character; I merely assumed it was the field delimiter.

Update II: Eliminating elements in your original posting makes your issue(s) a moving target and nullifies some responses; e.g., you've removed the record-size 'problem.' Nevertheless, your reformatting evidences a newline in one of your variables, and by the break in your output string, you should be able to tell which variable and then remove the newline.


In reply to Re: how can i increase the size of a record in a file by Kenosis
in thread how can i increase the size of a record in a file by rajsai28

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (5)
    As of 2014-12-22 05:12 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (110 votes), past polls