Sponsored Content
Top Forums Shell Programming and Scripting Trimming in between the words Post 302753691 by Jotne on Wednesday 9th of January 2013 08:02:53 AM
Old 01-09-2013
Code:
awk -F"_|:D" '{print $2}' infile

---------- Post updated at 14:02 ---------- Previous update was at 13:57 ----------

Code:
awk '{print substr($0,8,29)}' infile

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

trimming a file...

Hi everyone I have this script that appends a line to a file to log the running status of an application. I need to write another script to run as a scheduled job in cron to trim the first x number of lines of this file. Could someone give me an idea how to do this? Regards (1 Reply)
Discussion started by: alwayslearningunix
1 Replies

2. Shell Programming and Scripting

Trimming a string

Hi, I am trying to find a script command that will let me trim leading and trailing space from a string. I have coded a SQL Select and sending the output to a file. Later I am parsing the file and reading each field. The problem is that each field uses the same size as the DB2 type it was defined... (2 Replies)
Discussion started by: fastgoon
2 Replies

3. UNIX for Advanced & Expert Users

trimming zeros

Hi, I want to trim +with leading zero's with amount fields.I know using awk for trimming leading zeros with +,but I want get the entire row itself. cat file_name |awk -F " " '{printf "%14.4f%f\n",$4}' ex: 10 xyz bc +00000234.4500 20 yzx foxic +002456.000 Expexted 10 xyz bc... (3 Replies)
Discussion started by: mohan705
3 Replies

4. Shell Programming and Scripting

trimming lines

hi have output as i have trim of lines before CREATE statement and lins after last ")" any idea how to achieve it ? (3 Replies)
Discussion started by: crackthehit007
3 Replies

5. Shell Programming and Scripting

Trimming output

I'm trying to parse an output log and I've managed to reduce the output to the lines I need. But I'm having trouble pulling out only the info I'm interested in. The output is 40+ lines and here is a sample Installing AppFresh 0.8.5.pkg from ./InstallerFiles/CustomPKG/26 (26) Installing... (2 Replies)
Discussion started by: kaltekar
2 Replies

6. Shell Programming and Scripting

trimming sequences

My file looks like this: But I would like to 'trim' all sequences to the same lenght 32 characters, keeping intact all the identifier (>GHXCZCC01AJ8CJ) Would it be possible to use awk to perform this task? (2 Replies)
Discussion started by: Xterra
2 Replies

7. Shell Programming and Scripting

Shell script to find out words, replace them and count words

hello, i 'd like your help about a bash script which: 1. finds inside the html file (it is attached with my post) the code number of the Latest Stable Kernel, 2.finds the link which leads to the download location of the Latest Stable Kernel version, (the right link should lead to the file... (3 Replies)
Discussion started by: alex83
3 Replies

8. Shell Programming and Scripting

Trimming a string

Hi I need to trim white spaces from strings in a file. Input file is like this: 1_rrc_CatalogGroups.csv = 607 1_rrc_Sales_TopCatalogGroups.csv = 4 1_rrc_Sales_CatalogEntries_CatalogGroup_Rel.csv = 7 Need to trim space before and after = symbol. This is my script: #!/usr/bin/ksh ... (2 Replies)
Discussion started by: sukhdip
2 Replies

9. Shell Programming and Scripting

Gawk gensub, match capital words and lowercase words

Hi I have strings like these : Vengeance mitt Men Vengeance gloves Women Quatro Windstopper Etip gloves Quatro Windstopper Etip gloves Girls Thermobite hooded jacket Thermobite Triclimate snow jacket Boys Thermobite Triclimate snow jacket and I would like to get the lower case words at... (2 Replies)
Discussion started by: louisJ
2 Replies

10. Shell Programming and Scripting

Replace particular words in file based on if finds another words in that line

Hi All, I need one help to replace particular words in file based on if finds another words in that file . i.e. my self is peter@king. i am staying at north sydney. we all are peter@king. How to replace peter to sham if it finds @king in any line of that file. Please help me... (8 Replies)
Discussion started by: Rajib Podder
8 Replies
MAN(7)							 Miscellaneous Information Manual						    MAN(7)

NAME
man - macros to typeset manual SYNOPSIS
nroff -man file ... troff -man file ... DESCRIPTION
These macros are used to lay out pages of this manual. A skeleton page may be found in the file /usr/man/man.template. Any text argument t may be zero to six words. Quotes may be used to include blanks in a `word'. If text is empty, special treatment is applied to the next input line with text to be printed. In this way .I may be used to italicize a whole line, or .SM may be followed by .B to make small bold letters. A prevailing indent distance is remembered between successive indented paragraphs, and is reset to default value upon reaching a non- indented paragraph. Default units for indents i are ens. Type font and size are reset to default values before each paragraph, and after processing font and size setting macros. These strings are predefined by -man: *R `(Reg)', trademark symbol in troff. *S Change to default type size. FILES
/usr/share/tmac/tmac.an /usr/man/man.template SEE ALSO
troff(1), man(1) BUGS
Relative indents don't nest. REQUESTS
Request Cause If no Explanation Break Argument .B t no t=n.t.l.*Text t is bold. .BI t no t=n.t.l. Join words of t alternating bold and italic. .BR t no t=n.t.l. Join words of t alternating bold and Roman. .DT no .5i 1i...Restore default tabs. .HP i yes i=p.i.* Set pre- vailing indent to i. Begin paragraph with hanging indent. .I t no t=n.t.l. Text t is italic. .IB t no t=n.t.l. Join words of t alternating italic and bold. .IP x i yes x="" Same as .TP with tag x. .IR t no t=n.t.l. Join words of t alternating italic and Roman. .LP yes - Same as .PP. .PD d no d=.4v Interparagraph distance is d. .PP yes - Begin paragraph. Set prevailing indent to .5i. .RE yes - End of relative indent. Set prevailing indent to amount of starting .RS. .RB t no t=n.t.l. Join words of t alternating Roman and bold. .RI t no t=n.t.l. Join words of t alternating Roman and italic. .RS i yes i=p.i. Start relative indent, move left margin in distance i. Set prevailing indent to .5i for nested indents. .SH t yes t=n.t.l. Subhead. .SM t no t=n.t.l. Text t is small. .TH n c x v m yes -Begin page named n of chapter c; x is extra commentary, e.g. `local', for page foot center; v alters page foot left, e.g. `4th Berkeley Distribution'; m alters page head center, e.g. `Brand X Programmer's Manual'. Set prevailing indent and tabs to .5i. .TP i yes i=p.i. Set prevailing indent to i. Begin indented paragraph with hanging tag given by next text line. If tag doesn't fit, place it on separate line. * n.t.l. = next text line; p.i. = prevailing indent 7th Edition October 22, 1996 MAN(7)
All times are GMT -4. The time now is 01:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy