10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All,
I have three input files
cat file1
col1|col2|col3
a|1|A
b|2|B
cat file2
col1|col2|col3
c|3|C
cat file3
col1|col2|col3
d|4|D
e|5|E
i want below output
file4 col1|col2
a|1 (6 Replies)
Discussion started by: looney
6 Replies
2. Shell Programming and Scripting
Hi
i have a 2 files say test1 and test2 with the following data.
cat file
test
test1
i want to append the output from a awk one liner to both the files.
for i in cat file;do awk '/
whats happening is its printing the output properly. but not appending the way it showing in print... (1 Reply)
Discussion started by: venkitesh
1 Replies
3. Shell Programming and Scripting
I am trying to get grep with awk command into variable.
But facing error.
Could someone pls help.
$ cat test_file
DEPLOYMENT="abc" # com
cluster="bcn"
$ grep DEPLOYMENT test_file | awk -F "\"" '{ print $2 }'
abc
$ a=`echo "grep DEPLOYMENT test_file | awk -F \"\\\"\" '{ print $2 }'"` ;... (6 Replies)
Discussion started by: Manasa Pradeep
6 Replies
4. Shell Programming and Scripting
hello all,
First time post here. I have searched a bit but could not find an exact answer. I have about a week's experience of Sed and Awk, and am having fun, but am a little stuck.
I am reformatting an xml file into json format. I have got this far:
{"clients":
...and so on. What I want... (22 Replies)
Discussion started by: singerfc
22 Replies
5. Shell Programming and Scripting
hi
i want to append zeros to a given number ( varying digits). the total length of the output should be 10 digits. For example:
1)input is var=347
output should be NewVar=0000000347
2) input is var=123456
output should be NewVar=0000123456
i am able to acheive this using typeset... (1 Reply)
Discussion started by: somi2yoga
1 Replies
6. Shell Programming and Scripting
Hi friends ,
I am confused with << EOF
EOF
Most of the cases I found
sqlplus $db_conn_str << EOF
some sql staments
EOF
another exapmle is
#!/bin/sh
echo -n 'what is the value? '
read value
sed 's/XXX/'$value'/' <<EOF
The value is XXX
EOF (1 Reply)
Discussion started by: imipsita.rath
1 Replies
7. Shell Programming and Scripting
Hello,
I am trying to solve for a couple of hours now the following problem:
I have n files and would like to add the third column of each file to a new file:
temp1.txt
1 2 3
1 2 3
1 2 3
temp2.txt
1 2 4
1 2 4
1 2 4
1 2 4
temp3.txt (2 Replies)
Discussion started by: creamcheese
2 Replies
8. Shell Programming and Scripting
Hi all,
I have two files called INPUT1 and INPUT2 and i am trying to append the values of INPUT1 to INPUT2 using AWK.
The INPUT1 file will always has a single field and the INPUT2 file has 3 fields but both files will have same number of records always. Following is the format of the... (5 Replies)
Discussion started by: harris2107
5 Replies
9. Shell Programming and Scripting
ABC:10:A1:ABCA110
ABC:10:A1:ABCA110
ABC:20:A1:ABCA120
DEF:20:D1:DEFD120
GHI:30:G1:GHIG130
GHI:40:G1:GHIG140
JKL:30:J1:JKLJ130
MNO:10:M1:MNOM110
What I'm trying to do is look through a file that consists of four columns (as above). As you can see there are duplicates in
the file, i.e.... (2 Replies)
Discussion started by: rowntree
2 Replies
10. Shell Programming and Scripting
I am looking for the substitution expression to remove the eof ^Z character at the end of a file in UNIX.
Can anyone help?
Thank you ! (2 Replies)
Discussion started by: placroix1
2 Replies