hi all,
there is a text file containing some data like number of samples , time ,x0...
i need to read only times of the sample and write it in a text file since i am taking large number of samples .can you please help me in solving this.
#!/usr/local/bin/perluse5.012;use warnings;use strict;# extract time in a file with the following format:# number_of_samples, time, x0, x1, ....# Expects that the data is comma+1space separated, change the split line if you have a different separator.my$filename=$ARGV[0];open(my$read_fh,'<',$filename);while(my$line=<$read_fh>){my@data=split/, /,$line;# split on comma+1spaceif(length$data[1]){print"$data[1]\n"}}close($read_fh);
If you want the output in another file just redirect the output on the command line to another file.