Sponsored Content
Full Discussion: Problem using gsub in gawk
Top Forums Shell Programming and Scripting Problem using gsub in gawk Post 302728151 by seanmonaco on Wednesday 7th of November 2012 11:36:22 AM
Old 11-07-2012
Thank you both so much!
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Gsub and nawk

Hello I have problem with reg-expr and function gsub(); File that I want to preprocess look like this: int table ; printf(" variable : ", variable) ; Using nawk I try something like this: for ( .... ) { line = $0 reg_expr = "\.\=]*" "" variable "" "\.\=]*" ; gsub( reg_expr... (1 Reply)
Discussion started by: scotty_123
1 Replies

2. Shell Programming and Scripting

strange problem with gawk

Hello Freinds, I am facing a starange problem with gawk . My programme is as follows #!/bin/sh gawk -v AMPLITUDE=$1 -v freq=$2 ' \ BEGIN{ for(i=0; i<=2559; i++){ validec = sprintf("%1.3f", AMPLITUDE * sin( (i/2559) * 2* freq * 3.14159 ) ) validec =... (6 Replies)
Discussion started by: user_prady
6 Replies

3. Shell Programming and Scripting

Help with AWK and gsub

Hello, I have a variable that displays the following results from a JVM.... 1602100K->1578435K I would like to collect the value of 1578435 which is the value after a garbage collection. I've tried the following command but it looks like I can't get the > to work. Any suggestions as... (4 Replies)
Discussion started by: npolite
4 Replies

4. Shell Programming and Scripting

awk gsub

Hi all I want to do a simple substitution in awk but I am getting unexpected output. My function accepts a time and then prints out a validation message if the time is valid. However some times may include a : and i want to strip this out if it exists before i get to the validation. I have shown... (4 Replies)
Discussion started by: pxy2d1
4 Replies

5. Shell Programming and Scripting

awk gsub simple problem

Hi New to shell script and awk and need assistance on this problem. I need to use a variable to substitute a string in an external file and write the changed info to another file. At first I did not know if you could use a variable as the sub value but the following showed me that I can. ... (3 Replies)
Discussion started by: hukcjv
3 Replies

6. Shell Programming and Scripting

How to use gsub and array

Hello, i'm searching for a solution to this problem. I have 2 files, the first one is like: <HTML> <HEAD> <TITLE>{$String1}</TITLE> </HEAD> <BODY> <P>{$String2}</P> </BODY> </HTML>and the other one: {$String1}; french {$String2}; italian {$String3}; english ... {$StringN}; I... (3 Replies)
Discussion started by: heaven25
3 Replies

7. Shell Programming and Scripting

Gawk field separator problem

I'm trying to run a code using gawk and I'm having some trouble with it. What I'm trying to do is pull out value11 from the following input: value11,value12,value13 value21,value22,value23 I have successfully done this before using awk with the following code: awk 'NR == 1 {FS=",";... (4 Replies)
Discussion started by: KomjongShawn
4 Replies

8. Shell Programming and Scripting

GSUB/Regex Help

I am trying to write my gsub regex to replace a bunch of special characters with spaces, so i can split it to an array and look at each word independently. However, my regex skills are slightly lacking and I appear to be missing a quote or something here. I am trying to replace the following... (6 Replies)
Discussion started by: nitrobass24
6 Replies

9. Shell Programming and Scripting

awk gsub

Hi, I want to print the first column with original value and without any double quotes The output should look like <original column>|<column without quotes> $ cat a.txt "20121023","19301229712","100397" "20121023","19361629712","100778" "20121030A","19361630412","100838"... (3 Replies)
Discussion started by: ysrini
3 Replies
gt5(1)							      General Commands Manual							    gt5(1)

NAME
gt5 - a diff-capable 'du-browser' SYNOPSIS
gt5 [ dir | file | dir file | file file2 ] [options] DESCRIPTION
gt5 reads the output of du, compares it with a du-log saved by the last run, converts it into HTML and opens the resulting file with a textbrowser. If files are given on the commandline they are expected to be (optionally gzip/bzip2-compressed) logfiles of du -akx /some/dir. It is up to you to take care that the given directories/files represent the same directory. gt5 will show lots of new files if you don't. ;-) OPTIONS
--cut-at float Files and directories that are below float percent of their parents are not shown. Default is 0.1, gt5 will accept values between 0.01 and 30. --debug Turn on debug. Generate HTML files and do not run browser. --diff-dir directory Use directory instead of ~/.gt5-diffs/ to read/store du-logs. This switch is ignored if gt5 is only used with files. --discard Do not save the current state, in other words: be able to diff against the old state again. This feature is disabled if gt5 is only used with files. --help Display brief help. --link-files Also insert links to files to access them from within gt5. This can be very handy if your browser is configured to handle the files MIME-type correctly. This feature is disabled if gt5 is only used with files. --max-depth int Do not show anything below a depth of int directories. Default is 5 (also see BUGS below). --max-lines int Only consider the int biggest files and directories within the output of du. --no-diffs Use this if you are not interested in the history of the directories processed, for example in /tmp. --save-as file DEPRECATED, use du -akx or du -ak (see --with-mounts), save the output to a file and run gt5 against one (ore two) of these files later. --save-state Force saving current state, overwriting a previous --discard. (Some people seem to have gt5 aliased to 'gt5 --discard'.) --verbose Display messages. --with-mounts By default gt5 calls du with -akx to ignore mounted filesystems. Use this to inspect mounted partitions too, i.e. call du with -ak HELPERS
If gawk or a textbrowser are missing and you want to install them into ~/bin (or /usr/local/bin if you have write access there), gt5 comes with the following helpers: --get-gawk Download, compile and install a copy of gawk. --get-links Download, compile and install a copy of links. --get-links2 Download, compile and install a copy of links2. --get-elinks Download, compile and install a copy of elinks. TEXTBROWSERS
It is recommended to use links with gt5. Other textbrowsers are also possible but there are several good reasons why links is given prior- ity over the others: elinks: links is much faster on startup/exit lynx: does not honor a documents coloring netrik: no colors, unfavourable cursor navigation retawq: no colors, can't handle <a name>-tags w3m: Version 0.5.2 and later are known to work. Older versions experienced unfavourable handling of <a name>-tag, unfavourable cursor navigation and no colors Only links/links2, elinks and lynx are now considered usable (and also chosen in that order). See ENVIRONMENT/GT5_BROWSER below. FILES
~/.gt5.html contains a copy of the last run ~/.gt5-diffs/ compressed du-logs are stored here ENVIRONMENT
GT5_BROWSER force using a (specific) textbrowser GT5_CHARSET force using a (specific) charset for HTML header instead of using $LANG GT5_DEBUG_DIR Directory where to write gt5.debug* data if --debug option is set. BUGS
Directories at depth max-depth are not browsable and so look like files. AUTHOR
Thomas Sattler <gt5 at gmx dot net> SEE ALSO
du(1), links(1), elinks(1), lynx(1) gt5 v1.4.0.1 July 2009 gt5(1)
All times are GMT -4. The time now is 04:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy