Sponsored Content
Top Forums Shell Programming and Scripting Insert underscore at certain places Post 302685195 by bartus11 on Saturday 11th of August 2012 07:33:19 AM
Old 08-11-2012
This is not the code I posted:
Code:
perl -pe 's/ +(P(A|a))/_\1/g;s/(P(A|a)\d+) +^1_/g;s/(P(A|a)\d+); ?^1_;_/g'

This is:
Code:
perl -pe 's/ +(P(A|a))/_\1/g;s/(P(A|a)\d+) +/\1_/g;s/(P(A|a)\d+); ?/\1_;_/g'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

problem with underscore in variable name

can you help please. variable 1 = TODAY=`date +"%Y%m%d"` i.e. echo $TODAY 20080407 DB=GERMANY echo $DB GERMANY echo $DB.$TODAY GERMANY.20080407 echo $DB.$TODAY_1.dmp GERMANY..dmp (3 Replies)
Discussion started by: pinkie
3 Replies

2. Shell Programming and Scripting

usage of underscore in awk

Hi what is the purpose of using underscore in awk. I suppose it is for defining macro's and reducing repeatation but can some one show me an example? (6 Replies)
Discussion started by: ahmedwaseem2000
6 Replies

3. Shell Programming and Scripting

allow only alphnumeric entry and an underscore

I am taking an user input which should only be an alphanumeric character or an underscore. How to i do it? (2 Replies)
Discussion started by: vickylife
2 Replies

4. UNIX for Advanced & Expert Users

google search changes with an underscore

How does adding an underscore change a google search? I was searching for John Elway and got different results with and without an unscore. (3 Replies)
Discussion started by: cokedude
3 Replies

5. Shell Programming and Scripting

Changing the character after the Underscore(_)

Hi Everyone, I am looking for a command that would do the following: 1) Change all the letters/words in a file to Lower case Letters/words. 2) Remove the Underscore (_) and Change the Character after the underscore (_) to an Uppercase letter. Example: File contains the below words: ... (5 Replies)
Discussion started by: filter
5 Replies

6. Shell Programming and Scripting

Insert underscore in place of column

Hi I tried to put underscore in place of column in a big file with lots of oclumns using the programm sed 's//_/g' Its showing error bash-3.2$ sed 's//_/g'saradrugbankgenedrugnewlist.txt >saradrugbankgenedrugnewlist3.txt sed: -e expression #1, char 11: unknown option to `s' if... (24 Replies)
Discussion started by: manigrover
24 Replies

7. Shell Programming and Scripting

underscore to dots

Hi, I have been trying to change underscores to dots. For example: 1122_91 1022_233 . 2237_23 9382_2339 2998_234 345_257 . . Desired output: 1122.91 1022.233 . 2237.23 9382.2339 2998.234 345.257 . . Any idea? Thanks (4 Replies)
Discussion started by: iconig
4 Replies

8. HP-UX

sed help with underscore problems

Hello, I have spent a couple of hours trying to answer this myself, so forgive me if the answer is simple but I have tried. I have a text file generated from svn log output which contains a list of files. Two regexps im using are * and * They both work but some lines has a mixture... (7 Replies)
Discussion started by: YogaBija
7 Replies

9. Shell Programming and Scripting

To count underscore in filename

Hi All I have a filename like below adsf_ghjt_kop_pol.csv Can you please get me a command for counting the number of underscore in the filename. In the above filename I should get output as 3, since the file name is having three underscore (5 Replies)
Discussion started by: ginrkf
5 Replies

10. Shell Programming and Scripting

Sum the fields with 6 decimal places - getting only 2 decimal places as output

I used the below script to Sum up a field in a file based on some unique values. But the problem is when it is summing up the units, it is truncating to 2 decimals and not 6 decimals as in the input file (Input file has the units with up to 6 Decimals – Sample data below, when the units in the 2... (4 Replies)
Discussion started by: brlsubbu
4 Replies
CURSES_UNDERSCORE(3)					   BSD Library Functions Manual 				      CURSES_UNDERSCORE(3)

NAME
curses_underscore, underscore, underend, wunderscore, wunderend -- curses underscore attribute manipulation routines LIBRARY
Curses Library (libcurses, -lcurses) SYNOPSIS
#include <curses.h> int underscore(void); int underend(void); int wunderscore(void); int wunderend(void); DESCRIPTION
These functions manipulate the underscore attribute on stdscr or on the specified window. The underscore() function turns on the underscore attribute on stdscr. The underend() function turns off the underscore attribute on stdscr. The wunderscore() and wunderend() functions are equivalent to underscore() and underend(), respectively, excepting that the attribute is manipulated on the window specified by win. The underscore() and underend() functions are equivalent to wattron(A_UNDERLINE) and wattroff(A_UNDERLINE), respectively. RETURN VALUES
These functions always return 1. SEE ALSO
curses_attributes(3), curses_standout(3) STANDARDS
The NetBSD Curses library complies with the X/Open Curses specification, part of the Single Unix Specification. HISTORY
These functions first appeared in NetBSD 1.5. BSD
October 13, 2002 BSD
All times are GMT -4. The time now is 02:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy