Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

comment on

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


Thanks for your post! I'm having the best success with your suggestion, some others caused perl to crash. :(

I pasted the snippet into my script ...

# while not eof # ============= while ($line = <INPUT>) { ($date, $time, $ampm, $filesize, $filename) = split(" ", $line); # remove commas from $filesize string # =================================== $filesize =~ s/,//;

and it successfully removed the first comma. (below)

Results from gnome-terminal:

1572,727,014 IN11-135.E01 1223 IN11-135.E01.txt 1572,694,696 IN11-135.E02 1572,740,428 IN11-135.E03 1572,785,002 IN11-135.E04 1572,696,748 IN11-135.E05 1572,745,871 IN11-135.E06 1572,737,726 IN11-135.E07 1572,785,459 IN11-135.E08 1572,777,135 IN11-135.E09 1572,751,922 IN11-135.E10 1572,684,462 IN11-135.E11 1556,456,660 IN11-135.E12 Total Files: 13 Avg Size: 0

The first comma was removed from each number. Now I'm off to to see how I can remove the remaining commas.

Thanks ... Allen.

In reply to Re^2: How to Remove Commas ? by allendevans
in thread How to Remove Commas ? by allendevans

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?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2023-02-02 01:07 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (15 votes). Check out past polls.