And also as per my i/p file, is there any way to replace full file with all code list with all county list(located only at a specific column), by reading list i/p from a file, using similar type of command?
Like in.,
my county_code.txt file
my i/p file:
and my o/p should be of format:
Actually I tried with.,
But it is not replacing the code with country.
Request you to suggest a solution for this, for replacing a specific field of every record.
I tried with the things, but again it is resulting in the same error:
As I mentioned earlier, awk with -F option is not working for me.
So I tried with nawk command, as above. I am able to seperate the fields from the file, but it is not replacing as a whole. But if I hardcode it is working fine. Request you to give the solution for the same.
Here is what works as you are requesting w/explanations...
awk '{sub("004","IND")}{print}' p.txt
Notes:
1. gsub is for replacing ALL occurrences of a pattern in an input line, sub just the first one
2. The "^" character designates the beginning of a line, which is not what you are dealing with here
3. BEGIN is only for actions to be performed prior to acting on the input file
4. The square brackets "[]" are used for array subscripts
exec(): 0509-036 Cannot load program /usr/opt/freeware/bin/rpm because of the following errors:
0509-022 Cannot load module /opt/freeware/lib/libintl.a(libintl.so.1).
0509-150 Dependent module /opt/freeware/lib/libiconv.a(shr4.o) could not be loaded.
0509-152 Member... (4 Replies)
Hi,
I wants to print the 9th column information with its path name in some txt file. Here is one line which works fine for me:
rfdir /castor/cern.ch/user/s/sudha/forPooja | grep data | awk '{print "rfio:///castor/cern.ch/user/s/sudha/forPooja/"$9}' > dataFilenames.list
rfdir=="ls -ltr" ... (2 Replies)
Hi,
I am able to login using su - or su directly ,
# prompt is coming, it doesnt ask for password.
any normal user on aix system is login using su - or su .
Please suggest where to change the configuration
direct root login is disabled in /etc/ssh/sshd_config file. (0 Replies)
Dear Brothers!
Need your help for the case where I am running one command on prompt and its giving us the correct output, but when i use the same command from shell its directs no output.:wall:
the command on command prompt is
ls -ltrh * | nawk '{if ($5~ '/$'M'/') print $9}' | grep -v... (1 Reply)
i am using this way to create zone1 and zone2
bash-2.05b# zonecfg -z zone1
zone1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone1> create
zonecfg:zone1> set zonepath=/zone/1
zonecfg:zone1> set autoboot=true
zonecfg:zone1> add net
zonecfg:zone1:net>... (6 Replies)
Hi All,
I have a got a problem ..
I have t files as below:
1.txt contains
-----
-----
-----
column 1, "cat",
column 24, "dog",
column 100, "rat",
-----
-----
-----
2.sh should contain
-----
-----
-----
awk 'BEGIN { printf ("%1s","cat")}' (19 Replies)
Hi
I am getting the uptime output as follows
12:40am up 4 day(s), 18:29, 2 users, load average: 38.97, 36.54, 34.89
The load average is too high .
I have checked the processes , but no process is taking too much cpu time
Please help (3 Replies)
hi ,
i used ls -ltr | cut -f 1 > \dev\tty
but all teh coulmns r getting printed instead of only one........how can i resolve this?
prob 2 :
wud be able start cutting from last field......supposing in the case of dyanmic list.i dunno the field number of last column.......so is... (3 Replies)
Hi,
I am doing this perl script
print (@line(1..15));
the lines 1 to 15 get printed...
how can i redirect this to file?
thanks and regards
vivek.s (4 Replies)