emilybartholomew
Technical User
I have lots of files, which are in the format:
"date", "message"
"date", "message"
.
.
.
I am looping through all files (INFILE) and putting each line of the file into a database table with the following code:
while (my $line = <INFILE>){
my @line = split( /","/, $line);
$message_date = $line[ 0 ];
$message_text = $line[ 1 ];
#etc......
}
Unfortunately, sometimes the "message" part of the csv files has a newline in it, which makes it so that I lose the rest of the message. I'd like to somehow get rid of the unneccesary newlines and be able to capture the whole message for each date.
"date", "message"
"date", "message"
.
.
.
I am looping through all files (INFILE) and putting each line of the file into a database table with the following code:
while (my $line = <INFILE>){
my @line = split( /","/, $line);
$message_date = $line[ 0 ];
$message_text = $line[ 1 ];
#etc......
}
Unfortunately, sometimes the "message" part of the csv files has a newline in it, which makes it so that I lose the rest of the message. I'd like to somehow get rid of the unneccesary newlines and be able to capture the whole message for each date.