#!/usr/bin/perl # http://perlmonks.org/?node_id=1175477 use strict; use warnings; while(<DATA>) { s/^\S+\s+(\d+)computer(\d+).*\K/ $1host$2/; print; } __DATA__ 1.1.1.1 01computer12 01computer12.abc.com 1.1.1.2 34computer21 34computer21.abc.com
In reply to Re: How to re-arrange and edit lines in a text file
by tybalt89
in thread How to re-arrange and edit lines in a text file
by Frobozz
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |