|
|
| Bitochon 2005-11-17, 6:55 pm |
| Does anyone know how to append at the end of every line in a perl file.
I have a file that has 3 fields as Field1 Field2 Field3 they are
separate by a space. I need to append " field4" at the end of each
line. I also require that the dat of the file doesn't change.
Dave
<a href="http://www.bitochon.com">http://www.bitochon.com</a>
| |
|
| Is this work for you ?
sed '/^./s/$/ Field4/ perl-file
Or
awk '$0 !~ /^$/ {print $0,"Field"}' perl-file
Bitochon wrote:
> Does anyone know how to append at the end of every line in a perl file.
> I have a file that has 3 fields as Field1 Field2 Field3 they are
> separate by a space. I need to append " field4" at the end of each
> line. I also require that the dat of the file doesn't change.
>
> Dave
> <a href="http://www.bitochon.com">http://www.bitochon.com</a>
| |
| Bitochon 2005-11-18, 9:55 pm |
| I am using active perl and those commands don't seem to exist?
| |
| Michael Heiming 2005-11-18, 9:55 pm |
| In comp.lang.awk Bitochon <info@bitochon.com>:
> I am using active perl and those commands don't seem to exist?
awk and sed aren't perl commands. Install a real OS and you
should have both available per default.
Good luck
BTW
Please read this before posting anything else:
http://cfaj.freeshell.org/google
--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvpunry@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 382: Someone was smoking in the computer room
and set off the halon systems.
|
|
|
|