And so on. This text file was produced from 120 smaller .csv files, as you can probably guess from the names .. lol. What I need to do is to save each individual 'block' of numeric values .. for examplefilename = without012.csv pred = -0.0105 0.0645 0.1989 0.0151 0.0289 0.0400 0.5313 filename = without013.csv pred = -0.0080 0.0663 0.1911 0.0075 0.0288 0.0302 0.5234 filename = without014.csv pred = -0.0023 0.0595 0.2582 0.0323 0.0285 0.0578 0.5807
Into separate files, with each file being saved according to the smaller files from which these results originate. So, for the example below-0.0023 0.0595 0.2582 0.0323 0.0285 0.0578 0.5807
I would like to save the numeric block in a small file called without014.csv.filename = without014.csv pred = -0.0023 0.0595 0.2582 0.0323 0.0285 0.0578 0.5807
I was hoping that it would print out just the file names initially and then I was going to use the same technique for extracting the numeric block but all I am getting is blank lines when I run it (and yes, I'm checking that I am attempting to print off 'the right line' lol).#!/usr/bin/perl @file = <>; for($i = 0; $i < @file; $i+4) { print "$file[$i]"; }
In reply to extracting data and saving into seperate files by Angharad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |