I want to seggregate based on the 4th column i.e. if it is 1.0, 2.0, 3.0, 4.0 & 5.0 den i need to add a column with value S30 in between 3rd and 4th i.e. as shown below
91886,000,MiniC2-00,S30,1.0,aML,en
else add a column with value S40 in between 3rd and 4th i.e. as shown below
91886,000,MiniC2-00,S40,1.9.12,aML,en
---------- Post updated at 05:06 PM ---------- Previous update was at 05:03 PM ----------
Code:
set -x
>proper_file
IFS=','
while read col1 col2 var model other
do
if [ "$var" = "1.0" -o "$var" = "2.0" -o "$var" = "3.0" -o "$var" = "4.0" -o "$var" = "5.0" ]
then
sed "s/$model/S30/g" >> proper_file
else
sed "s/$model/S40/g" >> proper_file
fi
done < normal.csv
~
thanks PAMU, frank & MYSELF
Use shell built-in whenever possible since it will reduce processing time.
Cheers,
Ranga
---------- Post updated at 09:07 AM ---------- Previous update was at 08:55 AM ----------
Hello,
I need to know all IP range (ip_prefix), associated with us-west-2 region only from this link - https://ip-ranges.amazonaws.com/ip-ranges.json (it can be opened in wordpad for better visibility)
Please suggest, how would I do it. If vi, awk or sed is needed, I have downloaded it on my... (7 Replies)
Hi All,
I have a file like this(having 2 column).
Column 1: like a,b,c....
Column 2: having numbers.
I want to segregate those numbers based on column 1.
Example:
file.
a 5
b 9
b 620
a 710
b 230
a 330
b 1910 (4 Replies)
Hi All,
I have scenario where I need to zip huge number of DB audit log files newer than 90 days and delete anything older than that. If the files are too huge in number,zipping will take long time and causing CPU spikes. To avoid this I wanted to segregate files based on how old they are and... (2 Replies)
I have some text like
EU1BTDAT:ASSGNDD filename='$SEQFILES/SUNIA.PJ008202.CARDLIB/DATECARD'
EU1BTDATEST:ASSGNDD filename='$SEQFILES/SUNIA.PJ008202.CARDLIB/DATECARD'
EU1CLOSEDATES:ASSGNDD filename='$SEQFILES/SUNIA.PJ008202.CARDLIB/DATECARD'
EU1DATED:ASSGNDD... (8 Replies)
I have following files at /dir1
a.csv.20131201
b.csv.20131201
c.csv.20131201
d.csv.20131201
a.csv.20131202
b.csv.20131202
c.csv.20131202
d.csv.20131202
.......................
.......................
.......................
.......................
I need to move these files to... (4 Replies)
I have a variable containing values like 10d2, 7a7, a8 or d6 (i.e. <digits><alpha><digits>. Out of these leading digits may not be there. Out of this, I want three variables. The first having value Inital digits, the second one will be alpha and the third will be trailing digits. (In the previous... (2 Replies)
I need to deploy a JAVA application on two separate servers:
1. Web server (IBM HTTP Web Servers (IHS))
2. Application Server (WebSphere Application Server WAS7.0)
The static content will have to be deployed and handled on Web server. These would include GIFs, HTML, CSS, etc files.... (0 Replies)
print 'test'
SETUSER 'dbo'
go
create proc abc
as
/Some code here/
go
SETUSER
go
print 'test1'
SETUSER 'dbo'
go
Create Procedure xyz
as
/some code here/
go
SETUSER
go
print 'test2'
SETUSER 'dbo' (2 Replies)