05-21-2013
Word boundary with awk in ksh
Hi All,
I am searching for IP address pattern in some files which I want to replace with some characters. However when I replace the IP numbers, it also replaces other characters beyond the IP address like below-
125.29.234.18.23456->SSS.SS.SSS.SS.SSSSS
In the above example it should not replace the 23456 with the new characters. It should be-
125.29.234.18.23456->SSS.SS.SSS.SS.23456
this thing I am doing with awk in ksh. I don't know how to specify word boundary for this IP address so that only 4 numbers separated by 3 dots which form the the IP address should be replaced with the characters.
thanks in advance for the reply.
8 More Discussions You Might Find Interesting
1. Programming
Hi,
I have tcp/ip client server programs which will communicate through reqest,reply c-structures.
As the sizeof(struct) may give different value between client and server programs, how do i align properly for boundary conditions.
Could anybody please give some suggestion.
Thanks in... (3 Replies)
Discussion started by: axes
3 Replies
2. Solaris
hi Guys ..
user want mirror disk c3t9d0 (running ) to c2t9d0 (fresh hdd).
when i tried to
bash : prtvtoc /dev/rdsk/c3t9d0s2 | fmthard -s- /dev/rdsk/c2t9d0s2
it showing following error
Partition 0 not aligned on cylinder boundary: " 0 4 222 .....
unable to mirror ....
plz... (1 Reply)
Discussion started by: coolboys
1 Replies
3. UNIX for Dummies Questions & Answers
Hi
Please can you help how do I count the number of specific characters or words that appear in a file? (8 Replies)
Discussion started by: fretagi
8 Replies
4. Red Hat
Can you please help me to remove this error.
Disk /dev/sda: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk... (4 Replies)
Discussion started by: karthik9358
4 Replies
5. UNIX for Dummies Questions & Answers
Hi Guys,
Another questions to the genius over here. I have spool the dataf from the database into a .csv file. But can it be possible to have all the rows and column with the boundaries..for example the .csv file which i have is as below:
20140327 BU 9A 3
20140327 SPACE 9A 3
20140327... (8 Replies)
Discussion started by: Pramod_009
8 Replies
6. Shell Programming and Scripting
echo {mbr_key,grp_key,dep_key,abc,xyz,aaa,ccc} |
awk 'gsub(/^|abc,|$/,"") {print}'
Required output
{grp_key,xyz,aaa,ccc} (5 Replies)
Discussion started by: 100bees
5 Replies
7. Shell Programming and Scripting
Hi Help,
I am trying to create something like ---
Suppose, I have grid origin at X=600000.0 & Y=90000.0.
For any values of X, Y values lying within a circular periphery defined by circle of radius R=500m;X=599500.0 & 600500.0 ;Y=90500.0 & 89500.0should have a default=0or else it should... (4 Replies)
Discussion started by: Indra2011
4 Replies
8. UNIX for Beginners Questions & Answers
I have a multicolumn text file with header in the first row like this
The headers are stored in an array called . which contains I want to search for each elements of this array from that multicolumn text file. And I am using this awk approach
for ii in ${hdr}
do
gawk -vcol="$ii" -F... (1 Reply)
Discussion started by: Atta
1 Replies
LEARN ABOUT DEBIAN
kc2img
kc2img(1) General Commands Manual kc2img(1)
NAME
kc2img - convert KC files to raw KC tape images
SYNOPSIS
kc2img <infile> <outfile>
DESCRIPTION
kc2img converts the following file types to raw KC tape images. Those files contain the data bytes as written by the KC tape routines with
block number and checksum removed. So each block is saved as 128 bytes.
Machine code files start with an 128 byte header (one block) that contains filename, load start address, load end address and optionally a
start address whose presence is flagged by a status byte. Basic files only have a 13 byte header with filename and filesize.
1) files used by the KC emulator by Arne Fitzenreiter (usually named .TAP)
2) files used by the GEMINI-SOFT KC emulator (usually named .GPF for machine code files and .GBF for basic files)
3) BASIC files (usually named .SSS)
4) KC image files that contain the data written by the KC tape routines without block number and checksum (usually named .KCC or .KCB where
the .KCB files are BASIC files with an autostart routine)
BUGS
Basic files are not handled properly.
SEE ALSO
kcemu(1x), kctape(1), kc2tap(1), kc2wav(1), kc2raw(1)
AUTHOR
This manual page was written by Torsten Paul <Torsten.Paul@gmx.de>, for the Debian GNU/Linux system (but may be used by others).
kc2img(1)