in reply to Re: Reading File and Seperating into columns
in thread Reading File and Seperating into columns
I'm just stuck and don't know how I am going to separate the fields into a readable format. Thanks for pointing out that 99HEADER appeared twice that slipped by me.
So this is what I have so far:This separates the lines I need from the file after more data analysis I realised that there are more areas with 99 Factors appear.I basically just need to cut fields up so that they can be read by your standard user.#! /usr/bin/perl -w use strict; my @files = <*.in>; for my $file (@files) { open my $handle, '<', $file; chomp(my @lines = <$handle>); close $handle; open my $write, '>', "$file.sep"; my @enr_data = grep {/^99/} @lines; s/99/\n99/g for (@enr_data); close($handle); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Reading File and Seperating into columns
by boftx (Deacon) on Sep 26, 2013 at 22:31 UTC |