10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I use the two awk scripts for comparing file1 and file2.
First awk compare $3 column:
awk -v OFS="\t" 'NR==FNR{a=$4;next}{$2=$2 "\t"(a?a:"-")}1' file1 file2Second awk compare $2 column:
awk -v OFS="\t" 'NR==FNR{a=$4;next}{$2=$2 "\t"(a?a:"-")}1' file1 file2 The only difference
... (12 Replies)
Discussion started by: cmccabe
12 Replies
2. Shell Programming and Scripting
Hi Team,
I am new to unix, please help me in this.
I have a file named properties.
The content of the file is :
##Mobile props
east.url=https://qa.east.corp.com/prop/end
west.url=https://qa.west.corp.com/prop/end
south.url=https://qa.south.corp.com/prop/end... (2 Replies)
Discussion started by: tolearn
2 Replies
3. Shell Programming and Scripting
Hi, I have files, with fixed length fields/let's say every field 5 positions/, like this:
xxxx 140 xxxxx
xxxx 140 xxxxx
xxxx 1400 xxxxx
xxxx 150 xxxxx
I need to get only the records, which have 140 in the second column. I use that command:
nawk '{if (substr($0,6,3)=="140") print $0}'... (3 Replies)
Discussion started by: apenkov
3 Replies
4. Shell Programming and Scripting
Hi,
I have a file which contains data in this form.
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;... (2 Replies)
Discussion started by: arijitsaha
2 Replies
5. UNIX for Dummies Questions & Answers
Hi all,
I am editing a config file in vi that has a / on it.
At the moment, search and replace looks alright as am able to use a # as a temporary separator, i.e. :,$s#/u01/app#/u02/app#g
For doing a search, I have to escape the / do. So if I want to search for /u01/app, I am having to do... (2 Replies)
Discussion started by: newbie_01
2 Replies
6. Shell Programming and Scripting
Hello Experts,
I have a input file that I need to replace a value only if the file contains the number 6 in column 1. I would like to use AWK in a shell script (ksh on a AIX platform). I need all rows written out, but only change 2 fields when the first column contains a numer 6.
Input... (2 Replies)
Discussion started by: scottb
2 Replies
7. Shell Programming and Scripting
Dear All,
i want to search particular string and want to replance next line value.
following is the test file.
search string is
tmp,???
,10:1 "???" may contain any 3 character it should remain the same and next line replace with ,10:50
tmp,123 --- if match tmp,??? then... (3 Replies)
Discussion started by: arvindng
3 Replies
8. Shell Programming and Scripting
Hello,
I really would appreciate some help with a bash script for some string manipulation on an SQL dump:
I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump.
This is quite easy with sed:
sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies
9. Shell Programming and Scripting
Hi All,
Suppose I have a file "a.doc"
It's contents are :
mos44.0 )
.....
......
.....
export TKTS_RELEASE=tkts44.0b7
......
.......
Now , I need to first search for the pattern "mos44.0 )" and then TKTS_RELEASE will... (8 Replies)
Discussion started by: sanyerra
8 Replies
10. Shell Programming and Scripting
Hi All,
I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text.
An example of 4 lines in my file is:
1. MatchText_randomNumberOfText moreData ReplaceMe moreData
2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Discussion started by: Crypto
4 Replies