For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2004 > Help on output formatting









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help on output formatting
Sudhindra K S

2004-08-03, 9:02 am

_
Hi

I have a script which the following output:

" abc 123456 xyz

"

Now as you can see apart from the number "123456" there are a lot of blank spaces and some aplha characters as well. Now i want the output to be only "123456" without the white spaces, blank lines and characters.

How do i acheive this?

Thanks in advance.

Regards
Sudhindra




Marcos Rebelo

2004-08-03, 9:02 am

maybe you can do something like:

($text) =3D ($text =3D~ /([0-9]+)/);

Before printing the text.

> -----Original Message-----
> From: sudhindra k s [mailto:sudhindra_k_s@rediffmail.com]
> Sent: Monday, August 02, 2004 10:52 AM
> To: beginners@perl.org
> Subject: Help on output formatting
>=20
>=20
> =A0
> Hi
>=20
> I have a script which the following output:
>=20
> " abc 123456 xyz =20
>=20
> " =20
>=20
> Now as you can see apart from the number "123456" there are a=20
> lot of blank spaces and some aplha characters as well. Now i=20
> want the output to be only "123456" without the white spaces,=20
> blank lines and characters.
>=20
> How do i acheive this?
>=20
> Thanks in advance.
>=20
> Regards
> Sudhindra
>=20
>=20
>=20
>=20

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com