Hi,
i have 1200 line of data as below:
user1 date time @Glebe2037 Ha! but of course.....
user2 date time @aerynea It mostly missed Fort Collins
user3 date time Lansons is 20 years old this year
....
current output:
"@Glebe2037 Ha! but of course.....","10001","@aerynea It mostly missed Fort Collins","10002","Lansons is 20 years old this year","10003",............."11200".
i need your help to organize this output which is they will print \n everytime the id increase by 10.
require output:
"aaaaaaa","10001",..............."10010"
"bbbbbb","10011",..............."10020"
Any help much appreciated.
i have 1200 line of data as below:
user1 date time @Glebe2037 Ha! but of course.....
user2 date time @aerynea It mostly missed Fort Collins
user3 date time Lansons is 20 years old this year
....
current output:
"@Glebe2037 Ha! but of course.....","10001","@aerynea It mostly missed Fort Collins","10002","Lansons is 20 years old this year","10003",............."11200".
i need your help to organize this output which is they will print \n everytime the id increase by 10.
require output:
"aaaaaaa","10001",..............."10010"
"bbbbbb","10011",..............."10020"
Code:
#! /usr/bin/perl -w
use strict;
open( my $fh, '<', 'tweetdata.txt' )
or die "Ops sorry $!\n";
open MYFILE, ">output.csv";
select MYFILE;
my $lineno = 10001;
while (<$fh>) {
/^(\S+)\t([^\t]+)\t(.*)$/
or die "Invalid input: $_";
my $text = $3;
print "\"$text\",\"";
#print "$text\",\"";
print $lineno++;
print "\",";
}
Any help much appreciated.