in reply to Re^2: copy line with character
in thread copy line with character
If you are still available, I do have another question? :) If I want to include the second line after the line containing M and wrap it all into one line on the output file what would I have to include?
sample of input file: M12345678 John Doe 11/20/15 M987654 REJECTED FAILED --------------------------------------------- sample of output file: M12345678 John Doe 11/20/15 M987654 REJECTED FAILED use strict; my $find = '^M'; open (NEW, ">", "output.txt" ) or die "could not open:$!"; open (FILE, "<", "Report.txt") or die "could not open:$!"; while (<FILE>) { print NEW if (/$find/); } close (FILE); close (NEW);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: copy line with character
by stevieb (Canon) on Nov 23, 2015 at 19:37 UTC | |
by jalopez453 (Acolyte) on Nov 23, 2015 at 20:24 UTC | |
by stevieb (Canon) on Nov 23, 2015 at 20:33 UTC | |
|
Re^4: copy line with character
by BillKSmith (Monsignor) on Nov 23, 2015 at 20:44 UTC | |
by jalopez453 (Acolyte) on Nov 23, 2015 at 20:55 UTC | |
by AnomalousMonk (Archbishop) on Nov 23, 2015 at 23:07 UTC | |
by stevieb (Canon) on Nov 23, 2015 at 21:01 UTC | |
by BillKSmith (Monsignor) on Nov 24, 2015 at 15:41 UTC |