I have the printout below which may have many lines in it.
===================================================================================
Proxy Adm State Op. State MO
===================================================================================
22697 1 (UNLOCKED) 0...
The unix scripting forum gave me some script to perform what I needed, but I am stuck with an issue:
#begin code
BEGIN {
RS=FS=""
}
$1 ~ /^CB +/ && $2 ~ /^YES +/ { print prev }
{prev=$NF}
#end code
At the top of my file there is similiar to text below:
USERCODE:beaster
PASSWORD:
WO...
I have an input file called bsc_cells.txt that I need to count how many times
the items in column 2 appear.
The example input is below:
RXOTX-99-0 VA0449C ALL GSM1900 ALPHAC 45
RXOTX-99-1 VA0449C ALL GSM1900 ALPHAC 45
RXOTX-99-2 VA0449C ALL GSM1900...
I have a file called file1.txt
The contents are similiar to:
big red dog jumps over fence
blue bird in yard
hound chases fox
I need to use sed or something else to read the input file and output to new file2.txt after joining all the words to look like:
bigreddogjumpsoverfence
bluebirdinyard...
Would it just be easier to cat each file before I try to do what I am looking to do with field 1 and 6 by just sending those two columns to a new file?
If so, how do I cat only those two fields to a new file?
CaKiwi,
I added the above like this to the nawk program
BEGIN { RS="\r\n" }
FNR==NR && NF>5{a[$1]=$6;next}
NF>5{if($6+0>a[$1]+30)print $1,$6}
and got this back
vaossws03{root} #: nawk -f drop_nawk drops_temp3 test1 > test2
nawk: input record `VA0333C ...' too long
input record...
I am having an issue running it like CaKiwi's example.
I think it is failing because it thinks the first field is too long.
vaossws03{root} #: nawk -f drop_nawk drops_temp3 testfile > final.txt
nawk: input record `VA0333C ...' too long
input record number 0, file testfile
source...
It looks good, I have not tried it yet though.
Can you show me how to it should be written if I want to run it from the command line?
Like:
nawk -f file file
I need help with a script to compare two files. I know the
command "diff" but I think it needs to be a bit more complex
to do what I want.
I have two files. They are in the same directory. They both have
similiar text in them.
1st File: file1
2nd File: file2
The newest file is file1 and...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.