10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
so its common knowledge one can print multiple fields with simple commands like this:
echo 12 44 45 552 24 | awk '{print $1,$4,$3}'
but suppose i want to avoid specifying the "$" symbol. is that possible? can something like this be done:
echo 12 44 45 552 24 | awk '{print $(1,4,3)}'
... (9 Replies)
Discussion started by: SkySmart
9 Replies
2. Shell Programming and Scripting
In the attached file I am trying to use awk to extract multiple values and create the tab-delimited desired output.
In the output R_Index is a the sequential # and Pre_Enrichment is defaulted to ..
I can extract from the values to the side of the keywords, but most are above and I can not... (2 Replies)
Discussion started by: cmccabe
2 Replies
3. Shell Programming and Scripting
Can you please help me with this ....
Input File
share "FTPTransfer" "/v31_fs01/root/FTP-Transfer" umask=022 maxusr=4294967295 netbios=NJ09FIL530
share "Test" "/v31_fs01/root/Test" umask=022 maxusr=4294967295 netbios=NJ09FIL530
share "ENR California" "/v31_fs01/root/ENR California"... (14 Replies)
Discussion started by: greycells
14 Replies
4. Shell Programming and Scripting
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)
Discussion started by: nakaedu
2 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am learning awk and faced few queries. Kindly suggest on the same. Where it is wrong.
$ awk '{if (toupper($1) ~ /a/) print $0}' inv
$ awk '{if (toupper($1) ~ /A/) print $0}' inv -- Why this output
Jan 13 25 15 115
Mar 15 24 34 228
Apr 31 52 63 420
May 16 34 29 208... (6 Replies)
Discussion started by: vanand420
6 Replies
6. Shell Programming and Scripting
Hi,
I am trying to process 2 files simultaneously using awk satisfying following condition,
Both files contain 3 columns. It should take entry from column 1 from first file, look for that entry in file 2 and if found, add column 2 and column 3 from both files and output to third file. For e.g.... (4 Replies)
Discussion started by: muazfarooqaslam
4 Replies
7. UNIX for Advanced & Expert Users
Hi all,
I have input lines like below
empno,ename,sal,description
----------------------------
311,"jone,abc",2000,manager
301,david,200,"president,ac"
I need to sum the salary of them i.e. 2000+200
anything suggested
Thanks,
Shahnaz.
Use code tags. (5 Replies)
Discussion started by: shahnazurs
5 Replies
8. Shell Programming and Scripting
hai all
I am new to the world of shell scripting
I wanted to extract two columns from multiple files say around 25 files
and i wanted to get the separate outfile for each input file
tired using the following command to extract two columns from 25 files
awk... (2 Replies)
Discussion started by: hema dhevi
2 Replies
9. Shell Programming and Scripting
I need to print the second field of a file, taking spaces, tab and = as field separators.
; for 16-bit app support
MAPI=1
CMC=1
CMCDLLNAME32=mapi32.dll
CMCDLLNAME=mapi.dll
MAPIX=1
MAPIXVER=1.0.0.1
OLEMessaging=1
asf=MPEGVideo
asx=MPEGVideo
ivf=MPEGVideo
m3u=MPEGVideo (2 Replies)
Discussion started by: PamPam
2 Replies
10. UNIX for Advanced & Expert Users
Dear All,
I have two files, which looks like:
File 1
124
235
152
178
156
142
178
163
159
File 2
124|5623
452|6698
178|9995 (8 Replies)
Discussion started by: rochitsharma
8 Replies