Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Text to CSV with user input comma

by hdb (Prior)
on Jun 28, 2013 at 07:49 UTC ( #1041166=note: print w/replies, xml ) Need Help??

in reply to Text to CSV with user input comma

What is 'it' in 'it puts " (inverted commas ) in front of every word ' ?

Replies are listed 'Best First'.
Re^2: Text to CSV with user input comma
by shushant (Novice) on Jun 28, 2013 at 07:55 UTC
    it means the CPAN code

      Would you mind being more specific? Can you tell us which module you are using and show a few lines of the code where you use it?

        #!/usr/bin/env perl use Text::CSV; my $csv = Text::CSV->new(); open(my $in_fh, "<", "") or die "please create your temporary file: $!"; my @rows = (); + # keeps the count of rows in txt input file while( my $line = <$in_fh> ){ + # copies the line from our input chomp $line; push @rows, [ split m{ , }msx, $line ]; + } close $in_fh or die "could not close $in_file: $!\n"; $csv->eol( "\n" ); + # after each line it gives a new line command print " Please enter the name of your csv file in which you will make +modifications "; print "\n"; my $out_file = <>; chomp $out_file; open my $out_fh, '>', $out_file or die "could not open $out_file: $!\n +"; for my $row ( @rows ){ $csv->print( $out_fh, $row ) or die "could not print to $out_file: $ +!\n"; } close $out_fh or die "could not close $out_file: $!\n";
        This is what I am doing

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1041166]
[GotToBTru]: I
[GotToBTru]: ve been looking at a document we have been sending to a customer for years now
[MidLifeXis]: We don't, at least in this case ;-)
[GotToBTru]: and it includes a reference number that I didnt recognize
[GotToBTru]: I had to dig into the code to find out where it came from .. and it makes no sense
[GotToBTru]: so I emailed my contact asking if we could just stop sending it .. I'm afraid she is going to ask "what is that anyway?"
[MidLifeXis]: heh.
[MidLifeXis]: Most likely it is a code that some undocumented system, hidden behind layers of IT, deep in the bowels of the building under the machine room floor, reads that code to keep a presence switch from going off. :-b

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2017-01-20 19:04 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (176 votes). Check out past polls.