- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Perl assistance
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2003 02:49 AM
07-15-2003 02:49 AM
I have a perl script I was given.
It works like a charm except for one thing I have just discovered. It doesn't appear to use decimals.
The script takes a file with two columns. One being a column number, and one a value.
e.g.
1|2
2|2
3|42
It returns a file with the values in the appropriate columns.
e.g.
2|2|42
The problem is, if a value in the original file is say 0.442, then the output will be 0
Can anyone help me make this script notice decimals please?
for a in `ls $path/data/indexeditems`
do
perl -nle'/(\d+)\D+?(-?\d+)/&&$1 and$x[$1-1]=$2}END{$,="|";print@x' $path/data/indexeditems/$a > $path/data/lines/$a
done
Thanks for your time
Luke
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2003 04:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2003 05:19 AM
07-15-2003 05:19 AM
Re: Perl assistance
Thanks Ollie.
Any chance of telling me what "TAMTOATDI" means?
:)
Luke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2003 07:42 AM
07-15-2003 07:42 AM
Re: Perl assistance
I'm not quite sure how Ollie's acronym for TAMTOATDI works out, but I've seen it spelled TMTOWTDI, which is pronounced 'tim-toady' and stands for 'There's More Than One Way To Do It'. It's an expression familiar to Perl users because there are always many possible solutions to a problem using Perl.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2003 03:54 PM
07-15-2003 03:54 PM
Re: Perl assistance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2003 09:21 PM
07-15-2003 09:21 PM
Re: Perl assistance
I'm picking the fact that I made a typo!!! 8O)
Glad the script worked,
Ollie.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2003 09:35 PM
07-15-2003 09:35 PM