Thanks Rudi & Scrutinzer for the inputs. Reiterating my requirement once again as follows:
1. Input is from tar file named samplefile.tar.gz, so used following code
2. Dont want to untar the above file so used zcat.
3. Check the fields at 26th location for "01" from the tar file , so used following code
4. Also check the first character of 28th field, so used following code
5. Also check for 184th location for 3 bytes in BB array from bb.txt file, so used following code
Output required is to print all the lines from input (tar file) which is not matching the above conditions
How about applying our advices and creating / testing a revised code. If that does not work, come back for help. One more comment: As the bb.txt file entries and thus BB elements are having 4 chars, they will never match substr ($0, 184,3)...
tried changing code to as follows(used if condition) in case required i can pull other data using else if condition(for future requirement if any), but this prints the complete samplefile data (matching the condition)and not the substrs as mentioned in code below(see the printf). Please look into this & suggest
You weren't that far off with your first idea. After some polishing your code could look like
and should be working (replace my file names).
If testing long unstructured lines, sometimes single character columns come in handy (use FS=""):
I have recently built a new server and patched Soalris 10 up tp latest bundle etc...
When I run a decompress using the format zcat fred.Z |tar -xvf - it runs at a very slow rate.
A similiar server which is less powerful runs over twice as quick.
Is there any work arounds to configure decompress... (4 Replies)
Hello,
When i lauches this command
ssh -n server_name gunzip -c "/REP/xxxx.gz" > server.logThere are a few stray characters like NULNULNULNUL100644 NUL000000NUL000000NUL00024002704 12135060747 012607NUL at the beginning of server.log.
In the xxxx.gz there is a tar file
I'm not sure but it... (5 Replies)
Hi Guru's.
I am trying to use to check if $5 is greater than 80 & if not 100, then to print $0 :
awk '{ if ($5>80) && if ($5 != 100) print $0}
But getting error:
>bdf1|sed 's/%//g'|awk '{ if ($5>80) && if ($5 != 100) print $0}'
syntax error The source line is 1.
The error... (6 Replies)
Hi,
just i would like to know, how will be the response if you try to read a 40GB compressed file using zcat.
a)Uncompress the 40GB file and have it in the disk. use cat to view the steps.
b)Use zcat directly to view the compressed file?
What are the steps being occurred in step (b)?
Where... (3 Replies)
I created a backup script that emails all the admins when the backup is complete and attaches a log file of what what backed up. On occasion, something happens in which the backups stop working, I started "grep"ing around /var/log/syslog and I usually find the smoking gun. My goal is to zcat... (8 Replies)
Hi,
Putting across a few awk expressions.
Apart from the last, all of them are working.
echo a/b/c | awk -F'/b/c$' '{print $1}'
a
echo a/b/c++ | awk -F'/b/c++' '{print $1}'
a
echo a/b/c++ | awk -F'/b/c++$' '{print $1}'
a/b/c++
Request thoughts on why putting a '$' post double ++... (12 Replies)
Hi
I am trying to extract a <filename>.tar.Z on a SLES machine using zcat.
The command I am using is
zcat <filename>.tar.Z | tar xf -
When I use the above I get the following message
tar: Read 7168 bytes from -
I think the message is benign because I see that my files where... (2 Replies)
Hi all
I have more than 1000 files in a folder and when ever i use a "compress" or "zcat" command it give error
/bin/zcat: Arg list too long. .
any solution for this :o (3 Replies)
How can I find which version of Awk is installed? OpSystem is HPUX 11.x
I am getting an error when trying to use the keyword nextfile and I dont know why! (Well, I can only assume that I have am using a version of Awk that does not support nextfile. However, according to O'Reilly, nextfile is... (3 Replies)