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

Re: remove a comma

by golux (Chaplain)
on Jun 21, 2018 at 13:20 UTC ( [id://1217116]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    foreach my $line (<$infh>) {
        if ($line =~ /$re_data/) {
    ...
            push @data, "(" . join(",", split(/\s+/, $line)) . ")";
        }
    }
    
  2. or download this
    # Simply 'join' all data; last record contains neither comma nor newli
    +ne.
    my $data = join(",\n", @data);
    
  3. or download this
    #!/usr/bin/perl
    
    ...
    print $outfh $text;
    close($outfh);
    say "Wrote '$output'";
    
  4. or download this
    SELECT CUSTOMERID, ORDERID, CUSTOMERNAME, CUSTOMERLOCATION
    FROM DB.CUSTOMER_DATA
    ...
    (0005,60000005,mike,IN),
    (0006,70000006,bill,AK)
    )
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1217116]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-03-28 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found