Sponsored Content
Top Forums Shell Programming and Scripting matching a string followed by a number Post 302586960 by balajesuri on Tuesday 3rd of January 2012 07:08:40 PM
Old 01-03-2012
Using cut:
Code:
$ cut -d- -f1,2,4 inputfile
joe-dimech-drw.msf
peter-erch-drw.msf
pawlu-donje-varp3123.23

 

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. Shell Programming and Scripting

Need help matching a number

Using PERL. I have a variable called number. I need to match a range. The number can be no bigger than 6777 and no smaller than 2000. The number will always begin with a 2, 4, or 6. The next three numbers will range between 1 and 7. $number = xxxx I'm trying something like this but I... (1 Reply)
Discussion started by: x96riley3
1 Replies

3. Shell Programming and Scripting

Finding the line number of matching braces

Hi,I am new to shell scripting and i want to find the line numbers of matching braces. The file contents are as follows File XXX.dat 1 ( CLASS "FRUIT" 2 (TYPE "PERSISTENT") 3 (MESSAGE_TYPE "M") 4 (GET_REQRD "Y") 5 (SET_REQRD "Y") 6 ) 7 ( CLASS... (3 Replies)
Discussion started by: Rajendra_1510
3 Replies

4. Shell Programming and Scripting

find out line number of matching string using grep

Hi all, I want to display line number for matching string in a file. can anyone please help me. I used grep -n "ABC" file so it displays 6 ABC. But i only want to have line number,i don't want that it should prefix matching context with line number. Actually my original... (10 Replies)
Discussion started by: sarbjit
10 Replies

5. Shell Programming and Scripting

changing number in bash (number is in form of string)

I have a txt file as database. when i run my program what it does is it ask me for 3 name and stored in the file as name1:name2:name3:1 when u enter 3 name it add those in file as above format and add 1 at the end. I what i want is if i enter same names again it changes that 1 to 2 and so... (3 Replies)
Discussion started by: Learnerabc
3 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

Creating number by pattern matching

I have a certain mnemonic string from which I want to calculate a number The pattern follows three letters s, v and d. If a letter is by its own, the number assigned to the letter is assumed to be one. Else it takes the value preceeding it. I then need to add the numbers together. Example ... (5 Replies)
Discussion started by: kristinu
5 Replies

8. Shell Programming and Scripting

Matching a decimal number?

Hi everyone! Easy question for everyone. I'm trying to run a command line to find an exact match of a decimal number within a file. The number can be a positive OR negative number. For instance, if I want to find only the number -1 in the file that has: -17.6 -17 -16.3 -16.2 -15.7 -15.3... (6 Replies)
Discussion started by: lucshi09
6 Replies

9. Shell Programming and Scripting

Remove matching pattern on each line with number variations

Hello folks! I have a file containing lines like this Something text 18:37Remove This: 1,111"Keep this text" Some more text 19:37Remove This: 222"Keep this text" More text 20:50Remove This: 3,333Keep this text And more text 25:50Remove This: 44,444Keep this text I would like to... (4 Replies)
Discussion started by: martinsmith
4 Replies

10. UNIX for Beginners Questions & Answers

Concatenate a string and number and compare that with another string in awk script

I have below code inside my awk script if ( $0 ~ /SVC IN:/ ) { svc_in=substr( $0,23 , 3); if (msg_start == 1 && msg_end == 0) { msg_arr=$0; } } else if ( $0 ~ /^SVC OUT:/ ) { svc_out=substr( $0, 9, 3); if (msg_start == 1 && msg_end == 0) ... (6 Replies)
Discussion started by: bhagya123
6 Replies
trans(1int)															       trans(1int)

Name
       trans - translation tool for use with source message catalogs

Syntax
       trans [ -c ] [ -o name ] file.msf

Description
       The command assists in the translation of source message catalogs.  The command reads input from file.msf and writes its output to either a
       file named or a file you name on the command line.  The command displays file.msf in a multiple window screen that lets you  simultaneously
       see  the  original message, the translated text you enter, and any messages from the command.  This multiple window screen is easier to use
       for translating messages than a single window screen.

       The top window in the multiple window screen displays the text in the message source file file.msf.  The editor displays the  current  mes-
       sage in reverse video.

       In  the	center window, displays a prompt that asks you to enter a translated message.  You use a control key editor to move the cursor and
       delete text in the center window.  The control key sequences are defined as follows:

       ------------------------------------------
       Key Sequence   Meaning
       ------------------------------------------
       CTRL/k	      Display control key help
       CTRL/h	      Back space
       CTRL/l	      Forward space
       CTRL/w	      Back word
       CTRL/f	      Forward word
       CTRL/e	      Move to end of input
       CTRL/b	      Move to beginning of input
       CTRL/n	      Next line
       CTRL/p	      Previous line
       CTRL/u	      Delete input
       CTRL/i	      Insert mode (default)
       CTRL/r	      Replace mode
       DEL	      Delete previous character
       ------------------------------------------

       If you need to span more than one line with the translated text, type a backslash () and press the RETURN key to enable line continuation.
       After you finish entering the translated text, press the RETURN key to signal that you have finished translating that message.

       The  bottom  window  displays  any messages generated by If an error occurs, prompts you to re-enter the entire line, including the message
       label or number.

Options
       -c   Display comment lines beginning with a dollar sign ($) for translation, in addition to messages.

       -o   Call the output file name.	The default is output file name is

Restrictions
       Your terminal must be 80 columns by 24 lines for to display its three-window screen.

       You cannot interrupt a session and restart it at the point you stopped. You must complete the all the changes to a file	before	exiting  a
       file.

See Also
       intro(3int), extract(1int), gencat(1int), strextract(1int), strmerge(1int)
       Guide to Developing International Software

																       trans(1int)
All times are GMT -4. The time now is 08:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy