10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear all,
I am using the awk 'split' command to get the particular value.
FILE=InputFile_009_0.txt
Temp=$(echo $FILE | awk '{split($FILE, a, "e_"); print a}')
I would like to have the Temp take the value as : _009_0
... (4 Replies)
Discussion started by: emily
4 Replies
2. Shell Programming and Scripting
Hi,
My aim is to get the md5 hash of a file and store it in a variable.
var1="md5sum file1"
$var1
The above outputs fine but also contains the filename, so somthing like this 243ASsf25 file1
i just need to get the first part and put it into a variable.
var1="md5sum file1"... (5 Replies)
Discussion started by: JustALol
5 Replies
3. Shell Programming and Scripting
i am trying to cut the 4th field from the file.
sample file
a1,a2,"a,3",a4,a5,a6
b1,"b,2",b3,b4,b5,b6
c1,"c,2","c,3",c4,c5,c6
i need the output in the format of
a1,a2,"a,3",a5,a6
b1,"b,2",b3,b5,b6
c1,"c,2","c,3",c5,c6
i tried using cut -d, -f1-4,6-
but i am getting the output as ... (10 Replies)
Discussion started by: ATWC
10 Replies
4. Shell Programming and Scripting
Hi all, I'm trying to match the following two files with the code below:
awk -F, 'NR==FNR {a=$0; next} ($12,$4) in a {print $12,$1,a}' OFS="," file4.csv file3.csv
but the code does not print the entire row from file4 in addition to column 12 and 1 of file3.
file4:
o,c,q,co,ov,b... (1 Reply)
Discussion started by: bkane3
1 Replies
5. Shell Programming and Scripting
Hi,
I have to display the value 16 present in "lcpu=16" which is the output of a command
# vmstat
System configuration: lcpu=16 mem=4096MB
I used as
# hdtype=`vmstat | grep "lcpu" | awk -F "=" '{print $2}'`
# echo $hdtype
16 mem
But I need to display only 16..
Am doing... (3 Replies)
Discussion started by: Priya Amaresh
3 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I need a help with cut/awk command. I need to get certain values from a string provided. For example: i have a config file with below mentioned details
oracle="user=name"/"pass/word"@databasename.
I have used a command var1=`grep -w oracle sample.cfg | cut -d"=" -f2 | cut -d"/" -f1`.
... (10 Replies)
Discussion started by: kumars2102
10 Replies
7. Shell Programming and Scripting
Hi all ,
my script is sending output to a file , output is in below format :-
i want to cut , celltadm@avm-siapp01 from this output line . Starting and ending words can vary , like it can be any name as below -
so there will be only one "@" and i want to cut word just before and after... (8 Replies)
Discussion started by: deepakiniimt
8 Replies
8. Shell Programming and Scripting
awk experts,
I have a big file of 4000 columns with header. Would like to print the columns with string value of "Commands" in header. File has "," separator. This file is on ESX host with Bash.
Thanks,
Arv (21 Replies)
Discussion started by: arv_cds
21 Replies
9. Shell Programming and Scripting
input1
a_a a/a 10 100
a1 a_a 20 200
b1 b_b 30 300
input2
a_a a/a xxx yyy
a1 a1 lll ppp
b1 b_b kkk ooo
output
a_a a/a 10 100 xxx yyy (2 Replies)
Discussion started by: ruby_sgp
2 Replies
10. UNIX for Dummies Questions & Answers
Hi,
Let's say that I have a file called table, I know that if I need to see a the second column for exampls I use:
awk ' {print $2}' table.txt
Is there anyway to use awk to actually cut a column and put it somewhere else in the table?:confused: (8 Replies)
Discussion started by: cosmologist
8 Replies