just wanted to know what is the use of semicolon ; for multiple gsub() used under same loop. is it mandatory to use ; after each gsub() under a given loop ?
for (i in array)
{
gsub("^"i, array[i]) ;
gsub("Configuration file for "i, "Configuration file for " array[i])
}
moreover my awk cmd is in one line and looks complex , how can i break this to multiple line ? I am using this awk command under a shell script .
hello everyone....
script is: To convert the contents of a database file into uppercase
my code is:
printf "%s\n" , $2 | awk '{print toupper($2)}' emp.lst
i m able to do only for one field.....didn't get any sources for handling multiple fields.
please suggest me for multiple... (1 Reply)
I must design a UNIX script to monitor files whose size is over a threshold of 5 MB in a specific UNIX directory
I meet a problem during the for loop in my script. Some file names contain spaces.
ls -lrt | awk '$5>=5000000 && length($8)==5 {gsub(/ /,"_",$9); print};'
-rw-r--r-- 1 was61 ... (2 Replies)
Hi, i'm been browsing through the threads on how to do looping of multiple lines in awk but havent found the one i needed. I have a data which looks like this below. I need to compute for the monthly average of values per record and i used the awk argument below. how do i tell awk to execute the... (9 Replies)
Hi all.
I have the following command that is successfully searching for any one of the strings on all lines of a file and replacing it with the instructed value.
cat inputFile | awk '{gsub(/aaa|bbb|ccc|ddd/,"1234")}1' > outputFile
This does in fact replace any occurrence of aaa, bbb,... (2 Replies)
Hi,
I am trying to execute this line
awk -F ";" -v OFS=";" '{gsub(/\./,",",$6); print}' FILE
but for multiple fields $6 $7 $8
Do you have a suggstion?
Tried:
awk -F ";" -v OFS="";"" "function GSUB( F ) {gsub(/\./,\",\",$F); print} { GSUB( 6 ); GSUB( 7 ); GSUB( 8 ) } 1"... (2 Replies)
Hello, I had some difficulty to understand the gsub function and maybe the regex in this script to remove all the punctuations:
awk 'gsub(//, " ", $0)' text.txtFile text.txt:
This is a test for gsub
I typed this random text file
which contains punctuation like ,.;!'"?/\ etc.
The script... (6 Replies)
My program run without error. The problem I am having.
The program isn't outputting field values with the column headers to file.txt.
Each of the column headers in file.txt has no data.
MEMSIZE SECOND SASFoundation Filename
The output results in file.txt should show:
... (1 Reply)
Hi Forum.
I'm trying to cleanup the following data elements (To remove any occurences of commas and any extra spaces) while preserving the <TAB> delimiter using awk gsub but I have not been successful.
Original Data:
4365 monte des source rue,, ,<TAB>trevost<TAB>QC
Desired Data:... (1 Reply)
I am running Debian, mksh shell and #!/bin/mksh script.
Here is one instance I am trying to match. There are other level and n values, but they must be gathered in numerical order or the program will not work properly:
level="0" n="0"
Here is my code which does not work:
{ for (a = 0; a <=... (15 Replies)
Discussion started by: bedtime
15 Replies
LEARN ABOUT DEBIAN
config::model::models::lcdd::imonlcd
Config::Model::models::LCDd::imonlcd(3pm) User Contributed Perl Documentation Config::Model::models::LCDd::imonlcd(3pm)NAME
Config::Model::models::LCDd::imonlcd - Configuration class LCDd::imonlcd
VERSION
version 2.021
DESCRIPTION
Configuration classes used by Config::Model
generated from LCDd.conf
Elements
Protocol
Specify which iMon protocol should be used
Choose 0 for 15c2:ffdc device, Choose 1 for 15c2:0038 device. Optional. Type enum. choice: '0', '1'. upstream_default: '0'.
OnExit
Set the exit behavior 0 means leave shutdown message, 1 means show the big clock, 2 means blank device. Optional. Type integer.
upstream_default: '1'.
Device
Select the output device to use Optional. Type uniline. upstream_default: '/dev/lcd0'.
Contrast
Select the displays contrast Optional. Type integer. upstream_default: '200'.
Size
Specify the size of the display in pixels Optional. Type uniline. upstream_default: '96x16'.
Backlight
Set the backlight state Optional. Type enum. choice: 'on', 'off'. upstream_default: 'on'.
DiscMode
Set the disc mode 0 => spin the "slim" disc - two disc segments, 1 => their complement spinning;Optional. Type enum. choice: '0', '1'.
upstream_default: '0'.
SEE ALSO
o cme
perl v5.14.2 2012-11-09 Config::Model::models::LCDd::imonlcd(3pm)