Input:
Output:
There's some extra code in there, ignore it. The input has illegal numbers and a blank line at the end, just for fun.
Question: Can a character have more than one modifier? If so then alter the RE myChar '?' to be '*'.
You'll have to use the REs above with the match loop from the previous example if you want the actual strings. But, function gsub() is a good hack for what you described.
Output should have some break between records, it's hard to read. Toss in a print "--------------" somewhere for clarity.
Last edited by m1xram; 01-18-2011 at 07:04 AM..
Reason: add "Output:"
Hi,
I am trying out different scripts in PERL. I want to take a line/string as an input from the user and count the number of occurrances of all the alphabets (a..z) in the string. I tried doingit like this :
#! /opt/exp/bin/perl
print "Enter a string or line : ";
$string = <STDIN>;
chop... (5 Replies)
i have a string "dfasdfasdfadf"
i want to count the number of times each character is repeated..
For instance, d is repeated 4 times, f is repeated 4 times..
can u give a program in c (1 Reply)
Hi there, I have some user input in a variable called $VAR, and i need to ensure that the string is 5 or less characters .... does anybody know how i can count the characters in the variables ?
any help would be great, cheers (2 Replies)
This is my problem, my file (file A) contains the following information:
Now, I would like to create a file (file B) containing only the lines with 10 or more characters but less than 20 with their corresponding ID:
Then, I need to compare the entries and determine their frequency. Thus, I... (7 Replies)
Hello:
I have a large file which contains lines like the following:
1/t123ab, &Xx:1:1234:12345:123456@ABCDEFG... at -$100.00%
/t is a tab, spaces are as indicated
the string "&Xx:1:1234:12345:123456$ABCDEFG..." has a slightly variable number of numbers and letters, but it always starts... (9 Replies)
Hi Experts,
How to sepearate the list digit with letters : with a space from where the letters begins, or other words from where the digits ended.
file
52087mo(enbatl)
52049mo(enbatl)
52085mo(enbatl)
25051mo(enbatl)
The output should be looks like:
52087 mo(enbatl)
52049... (10 Replies)
Hi I have a source file that looks like
a,b,c,d,e,f,g,h,t,DISTI(USD),MSRP(USD),DIST(EUR),MSRP(EUR),EMEA-DISTI(USD),EMEA-MSRP(USD),GLOBAl-DISTI(USD),GLOBAL-MSRP(USD),DISTI(GBP), MSRP(GBP)
I want to basically change MSRP(USD) to MSRP,USD and DIST(EUR) to DIST,EUR and likewise for all i'm using... (3 Replies)
I have the following script that will print column 4 ("25") when column 1 contains "123". However, I need to ignore the alpha characters that are contained in the input file. If I were to ignore the characters my output would be column 3.
What is the best way to print my column of interest... (3 Replies)