Sponsored Content
Full Discussion: Sort roman numerals
Top Forums Shell Programming and Scripting Sort roman numerals Post 302508513 by Corona688 on Monday 28th of March 2011 11:02:10 AM
Old 03-28-2011
Quote:
Originally Posted by mirni
@centurion_13: arabic() is a function defined in Roman.pm module, to convert roman number to arabic
...and in case it's unclear, "arabic" numerals are normal numbers, digits 0 through 9 etc.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extracting only numerals from string.

Hi!!! i have two files "tushar20090429200000.txt" and "tushar_err20090429200000.txt" The numeric part here is date and time. So this part of file keeps changing after every hour. I want to extract the numeric part from the both file names and compare them whether they are equal or not. ... (4 Replies)
Discussion started by: tushar_tus
4 Replies

2. UNIX for Dummies Questions & Answers

Using CUT command to get only numerals from a string

I need help to get only the numerals from a string Ex : var1=Nightfox has 2 red apple(s) I need to cut only the numeral 2 and move it to a variable. var2=`$var1 | cut -c 14` the cut by character doesnt work, how to get only the numeral ? (2 Replies)
Discussion started by: happyrain
2 Replies

3. UNIX for Dummies Questions & Answers

Deleting lines starting with spaces then non-numerals

I did a search but couldn't find a thread that seemed to answer this but my apologies if it has been answered before. I have some text files and I need to remove any line that does not start with a number (0-9). In actuality every line like this starts with a 'T' (or 't') but there are a... (5 Replies)
Discussion started by: skray
5 Replies

4. Shell Programming and Scripting

How to select only those file names whose name contains only numerals.

Hi Guru's, Before writing to this forum I have searched extensively on this forum about my problem. I have to write a shell script which takes out only those file names from the given directory which contains only numbers. For example, In the given directory these files are present: ... (5 Replies)
Discussion started by: spranm
5 Replies

5. Shell Programming and Scripting

Sorting with header and mixed numerals (scientific and decimal) | awk

Assoc.txt CHR SNP BP A1 TEST NMISS OR STAT P 1 rs2980319 766985 A ADD 4154 1.024 0.1623 0.8711 1 rs2980319 766985 A AGECAT 4154 1.371 6.806 1.003e-11 1 ... (6 Replies)
Discussion started by: genehunter
6 Replies

6. UNIX for Advanced & Expert Users

Script to sort the files and append the extension .sort to the sorted version of the file

Hello all - I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Discussion started by: pankaj80
3 Replies

7. Shell Programming and Scripting

Help with sort word and general numeric sort at the same time

Input file: 100%ABC2 3.44E-12 USA A2M%H02579 0E0 UK 100%ABC2 5.34E-8 UK 100%ABC2 3.25E-12 USA A2M%H02579 5E-45 UK Output file: 100%ABC2 3.44E-12 USA 100%ABC2 3.25E-12 USA 100%ABC2 5.34E-8 UK A2M%H02579 0E0 UK A2M%H02579 5E-45 UK Code try: sort -k1,1 -g -k2 -r input.txt... (2 Replies)
Discussion started by: perl_beginner
2 Replies

8. Shell Programming and Scripting

Sort help: How to sort collected 'file list' by date stamp :

Hi Experts, I have a filelist collected from another server , now want to sort the output using date/time stamp filed. - Filed 6, 7,8 are showing the date/time/stamp. Here is the input: #---------------------------------------------------------------------- -rw------- 1 root ... (3 Replies)
Discussion started by: rveri
3 Replies

9. Shell Programming and Scripting

[FUN] Numbers to Roman letters/num

Heyas Just a little fun script (code block) i'd like to share for fun. #/bin/bash # roman.sh # # Function # num2roman() { # NUM # Returns NUM in roman letters # input=$1 # input num output="" # Clear output string len=${#input} # Initial length to count down ... (9 Replies)
Discussion started by: sea
9 Replies
Roman(3pm)						User Contributed Perl Documentation						Roman(3pm)

NAME
Text::Roman - Allows conversion between Roman and Arabic algarisms. SYNOPSIS
use Text::Roman qw/ isroman roman2int int2roman ismilhar milhar2int roman mroman2int ismroman /; print int2roman(123); $roman = "XXXV"; print roman2int($roman) if isroman($roman); $milhar = 'L_X_XXIII'; # = 60,023 print milhar2int($milhar) if ismilhar($milhar); DESCRIPTION
This package supports both conventional Roman algarisms (which range from 1 to 3999) and Milhar Romans, a variation which uses a bar across the algarism to indicate multiplication by 1,000. For the purposes of this module, acceptable syntax consists of an underscore suffixed to the algarism e.g. IV_V = 4,005. The term Milhar apparently derives from the Portuguese word for "thousands" and the range of this notation extends the range of Roman numbers to 3999 x 1000 + 3999 = 4,002,999. Note: the functions in this package treat Roman algarisms in a case-insensitive manner such that "VI" == "vI" == "Vi" == "vi". The following functions may be imported into the caller package by name: isroman Tests a string to be a valid Roman algarism. Returns a boolean value. int2roman Converts an integer expressed in Arabic numerals, to its corresponding Roman algarism. If the integer provided is out of the range expressible in Roman notation, an undef is returned. roman2int Does the converse of int2roman(), converting a Roman algarism to its integer value. ismilhar Determines whether a string qualifies as a Milhar Roman algarism. milhar2int Converts a Milhar Roman algarism to an integer. ismroman mroman2int roman These functions belong to the module's old interface and are considered deprecated. Do not use them in new code and they will eventually be discontinued; they map as follows: ismroman => ismilhar mroman2int => milhar2int roman => int2roman CHANGES
Some changes worth noting from this module's previous incarnation: namespace imports The call to use must now explicitly request function names imported into its namespace. argument defaults/void context All functions now will operate on $_ when no arguments are passed, and will set $_ when called in a void context. This allows for writing code like: @x = qw/V III XI IV/; roman2int() for @x; print join("-", @x); instead of the uglier: @x = qw/V III XI IV/; $_ = roman2int($_) for @x; print join("-", @x); SPECIFICATION
Roman algarisms may be described using the following BNF-like formula: a = I{1,3} b = Va?|IV|a e = X{1,3}?|X{0,3}IX| ee = IX| f = Le?|XLee?|e g = C{1,3}f?|C{0,3}XCee?|f gg = XCee?|f h = Dg?|CDgg?|g j = M{1,3}h?|M{0,3}CMgg?|h REFERENCES
For a description of the Roman numeral system see: http://www.novaroma.org/via_romana/numbers.html. A reference to Milhar Roman alagarisms (in Portuguese) may be found at: http://www.estado.estadao.com.br/redac/norn-nro.html. AUTHOR
Erick Calder <ecalder@cpan.org> ACKNOWLEDGEMENTS
This module was originally written by Peter de Padua Krauss <krauss@ifqsc.sc.usp.br> and submitted to CPAN by Stanislaw Pusep <stanis@lin- uxmail.org> who has relinquished control to me since the original author has never maintained it and can no longer be reached. I have completely rewritten the module, implementing simpler algorithms to perform the same functionality, adding a test suite, a Changes file, etc. and providing more comprehensive documentation. AVAILABILITY + SUPPORT For questions, comments and support please feel free to e-mail me. This module may be found on the CPAN. Additionally, both the module and its RPM package are available from: http://perl.arix.com DATE
$Date: 2003/01/16 01:56:34 $ VERSION
$Revision: 3.3 $ perl v5.8.8 2007-06-15 Roman(3pm)
All times are GMT -4. The time now is 03:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy