Search Results

Search: Posts Made By: verge
6,582
Posted By bartus11
Try:awk '{gsub("[^a-zA-Z]ISA[^a-zA-Z]","\n&")}1'...
Try:awk '{gsub("[^a-zA-Z]ISA[^a-zA-Z]","\n&")}1' fileandawk '{sub("^[^a-zA-Z]ISA","ISA")}1' file
1,612
Posted By vgersh99
nawk '/^ISA/...
nawk '/^ISA/ {f=1;close(file);file="file"++c}f{print > file} /^IEA/{f--}' myHugeFile
8,492
Posted By mirni
I'm not sure I understand what you mean there......
I'm not sure I understand what you mean there... or what exactly is the logic of extraction, but let me try:

Your input seems to have fields separated by '~'. awk does the processing line-by-line,...
8,492
Posted By mirni
Glad it worked. c109 is always alphanumeric,...
Glad it worked.
c109 is always alphanumeric, because its a hex code of the character (the whole file 'hexfile' that awk filters is made of hex codes).

So you wanna get char109 from original file...
8,492
Posted By mirni
Sounds like a fun project :) Let's break it...
Sounds like a fun project :)

Let's break it up:
1. convert to hex
2. store character 106 and 107
3. in hex format replace all char106's to '0a' if char107 is 'G'
4. convert hex back to ascii
...
4,927
Posted By Corona688
Yes. You could dump everything I wrote into a...
Yes. You could dump everything I wrote into a text file named script.awk (name unimportant), then run awk on that file in your ksh script with awk -f script.awk datafile

Or you could embed the...
4,927
Posted By Corona688
How about this: #!/bin/awk -f # This section...
How about this: #!/bin/awk -f
# This section gets run only once, before anything's read.
# using it for variable setup.
BEGIN {
# Don't have to check what the delimiter is, just split on...
4,927
Posted By Corona688
foo | grep | cut | sed | really | long | pipe |...
foo | grep | cut | sed | really | long | pipe | chain is never efficient, and you're doing this on almost every line. You've also got a lot of useless use of backticks...
3,228
Posted By bartus11
This should work:perl -p0e 's/[^[:print:]]/\n/g'...
This should work:perl -p0e 's/[^[:print:]]/\n/g' file
3,228
Posted By bartus11
So you want to replace all the "hex 1C"...
So you want to replace all the "hex 1C" characters with newline in your file? Or any non-printable character?
3,228
Posted By bartus11
As far as I know \W matches all non-alphanumeric...
As far as I know \W matches all non-alphanumeric characters, including non-ASCII and non-printable ones.
3,228
Posted By bartus11
Try:perl -p0e 's/ISA[\W_]/\n$&/g' file
Try:perl -p0e 's/ISA[\W_]/\n$&/g' file
Showing results 1 to 12 of 12

 
All times are GMT -4. The time now is 05:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy