Sponsored Content
Full Discussion: matching alphanumeric string
Top Forums Shell Programming and Scripting matching alphanumeric string Post 11733 by sskb on Tuesday 11th of December 2001 02:49:27 PM
Old 12-11-2001
Question matching alphanumeric string

how to match an alphanumeric string like the following.

i have to do like the following.

if the input line is

the data is {clock_91b}

i have to replace that with

the string was ("clock_91b")

i tried like

$line =~ s/the data is\s+\{([a-z]+)\}/the string was \(\"$1\"\)/

which is not working.
Is there any idea?
Smilie
sskb
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed problem - replacement string should be same length as matching string.

Hi guys, I hope you can help me with my problem. I have a text file that contains lines like this: 78 ANGELO -809.05 79 ANGELO2 -5,000.06 I need to find all occurences of amounts that are negative and replace them with x's 78 ANGELO xxxxxxx 79... (4 Replies)
Discussion started by: amangeles
4 Replies

2. UNIX for Dummies Questions & Answers

AlphaNumeric String Operations

Hi :) I am writing a ksh I have a string of general format A12B3456CD78 the string is of variable length the string always ends with numbers (here it is 78.. it can be any number of digits may be 789 or just 7) before these ending numbers are alphabets (here it is CD can even be... (3 Replies)
Discussion started by: lakshmikanth
3 Replies

3. Shell Programming and Scripting

With Regex Spliting the string into Alphanumeric and Numeric part

Hi there With shell script I'm trying to split the string into two parts. One is alphanumeric part, the other one is a numeric part. dummy_postcode_1 = 'SL1' --> res_alpha = 'SL' and res_numeric = '1' dummy_postcode_2 = 'S053' --> res_alpha = 'S' and res_numeric = '053' ... (1 Reply)
Discussion started by: ozgurgul
1 Replies

4. Shell Programming and Scripting

ksh - test if string contains alphanumeric...

Okay I will let users input spaces as well :) I am having a mental block. I have done a couple of searches but havent found anything that I understand (the likes of :alpha: and awk). Basically I want to give the user an option to enter some text which will go down as a field within a flat... (3 Replies)
Discussion started by: tugger
3 Replies

5. Shell Programming and Scripting

String matching

I have a string like ab or abc of whatever length. But i want to know whether another string ( for example, abcfghijkl, OR a<space> bcfghijkl ab<space> cfghijkl OR a<space>bcfghijkl OR ab<space> c<space> fghijkl ) starts with ab or abc... space might existing on the longer string... If so, i... (4 Replies)
Discussion started by: nram_krishna@ya
4 Replies

6. Shell Programming and Scripting

Matching string from input to string of file

Hi, i want to know how to compare string of file with input string im trying following code: file_no=`paste -s -d "||||\n" a.txt | cut -c 1` #it will return collection number from file echo "enter number" read " curr_no" if ; then echo " current number already present" fi ... (4 Replies)
Discussion started by: a_smith
4 Replies

7. Shell Programming and Scripting

parse a mixed alphanumeric string from within a string

Hi, I would like to be able to parse out a substring matching a basic pattern, which is a character followed by 3 or 4 digits (for example S1234 out of a larger string). The main string would just be a filename, like Thisis__the FileName_S1234_ToParse.txt. The filename isn't fixed, but the... (2 Replies)
Discussion started by: keaneMB
2 Replies

8. Shell Programming and Scripting

how to insert space in alphanumeric string

Hi everyone, I want help to insert space between digits and letters in a alphanumeric string. INPUT TRY234TER PHY1TYR EXPECTED OUTPUT TRY 234 TER PHY 1 TYR The lines always begin with the letters and the alphabets will be a three letter combination before and after the number. The... (2 Replies)
Discussion started by: kaav06
2 Replies

9. UNIX for Beginners Questions & Answers

Need to compare numbers in alphanumeric string

Hi, I will be having file names like below, 1420SP1.01804 1420SP1.01805D 1420SP1.01805 1420SP1.01806D 1420SP1.01806 1420SP1.01901D 1420SP1.01901 1420SP1.01902D 1420SP1.01902 1420SP1.01903D 1420SP1.01903 1420SP1.01904 1420SP1.01905 From this, I need to list file names which is... (3 Replies)
Discussion started by: Sumanthsv
3 Replies

10. Shell Programming and Scripting

Generate a string of alphanumeric characters

Hi, I want a script of a code that will allow me to generate all possible combinations of alphanumberica characters of length 12 such that each string will contain numbers and either small or capital letters. For example a string may look like this: 123AB45cd678. (11 Replies)
Discussion started by: faizlo
11 Replies
lltag_formats(5)						File Formats Manual						  lltag_formats(5)

NAME
formats - Internal formats database file for lltag DESCRIPTION
The internal format database is usually stored in /etc/lltag/formats. The user may override this file by defining a $HOME/.lltag/formats. If this file exists, the system-wide one is ignored. These files contain entries starting with a line such as: [%n - %a - %t] A title between bracket that will be displayed at runtime. Then, the following 3 lines must be given to explain how the format is actually used to parse filenames: type = basename The type is either basename (to parse the last part of the path to a file) or path (to parse the directory part of the path to a file). When actually parsing the path to target files, basename and path parsers will be assembled. All possible combination will be tried. regexp = %L%N%S-%S%A%S-%S%A%L A string composed of any characters, with the following special fields: %L for delimiter (empty by default, multiple spaces if --spaces was given) %S for a space (or multiple spaces if --spaces was given) %N for numbers %A for an alphanumeric string without / %P for any path (alphanumeric string with /) %% for % indices = NUMBER,ARTIST,TITLE A list of fields to match (either given by their full name or associated letter) corresponding to each %N or %A field in the previ- ous format. It may be AUTHOR (or a), ALBUM (A), GENRE (g), NUMBER (n), TITLE (t), DATE (d), COMMENT (c) or IGNORE (i). See also FORMAT in the manpage of lltag for details about these fields. SEE ALSO
lltag(1) AUTHOR
Brice Goglin NOVEMBER 2006 lltag_formats(5)
All times are GMT -4. The time now is 08:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy