[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text Manipulation



> 12345ABCDE67890FGHJK
> Q1W2E3R4T5Y6U7I8O9P0
> MNBHGVFRT7352508HY7S
> THISLINEHASNOBLANKS2
> ANOTHERLINEWITHNONE5
> 1MORELINEWITHNONEZZZ

$position_to_column = 7;  #This is the char count to put the column at,
                          #REMEMBER TO COUNT FROM ZERO THOUGH!

open(RFILE, "filetoreadfrom");
while(<RFILE>) {
	chomp;
	@line = split //, $_;
	for ($i = 0; $i < scalar(@line); $i++) {
		if ($i = 0) { @newline = ("@line[$i]"); next; }
		if ($i % $position_to_column = 0 && $i != 0) {
			@newline = (@newline, " ");
		} else {
			@newline = (@newline, "@line[$i]");
		}
	}
	print @newline "\n";
}
close(RFILE);


Ok, i didn't test this and i am too lazy too.  but, it might even work.
who knows.  it should give you a base to work from though.

tighe

-- 
Tighe		w00t		blumnky
	"I am anger incarnate."
	"Oh yeah?  I toss poo."



-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.