Search Results

Search: Posts Made By: script_op2a
4,654
Posted By script_op2a
Hi ! thanks for testing it :) Yes I...
Hi !

thanks for testing it :)

Yes I know it works the way it is but I will be using it with different files and I need to be able to change the field separator with a variable.

So I need to...
4,654
Posted By script_op2a
sort -t option causing code to fail need ASCII character
Hello,

When I run this UNIX code without the -t option it gives me the desired results.

The code keeps the record with the greatest datetime based on the key columns.
I sort it first then sort...
8,968
Posted By script_op2a
Hello, thank you very mucho for your post, ...
Hello, thank you very mucho for your post,

Do you mean using sort instead of awk? Do you think I could do it using only sort?
If so, could you explain the different piped sections?

Let me see...
6,137
Posted By script_op2a
Yes, the concept of the sort occured to me some...
Yes, the concept of the sort occured to me some more.

The script I have determines duplicates by a concatenation of specific columns in the file (the key) and uses another column ( a datetime) to...
6,137
Posted By script_op2a
I installed gawl 3.1.18 in a directory and ran...
I installed gawl 3.1.18 in a directory and ran the script replacing gawk for awk
and I got the error

out of memory (need more space)then I tried it again in gawk and got no error but it didn't...
Forum: HP-UX 05-24-2011
2,758
Posted By script_op2a
what is the latest awk patch?
on the server I do these commands and I get this:

uname -a
to find version of server OS

HP-UX b8mkesc1 B.11.23 U ia64 2190843824 unlimited-user license

to find version of awk

what...
6,137
Posted By script_op2a
well I found the HP server's version and awk...
well I found the HP server's version and awk patch version

uname -a
HP-UX servername B.11.31 U ia64 2183943116 unlimited-user license

what /usr/bin/awk
/usr/bin/awk:
$Revision:...
6,137
Posted By script_op2a
Hi, I tried running the script using the...
Hi,

I tried running the script using the latest version of gawk 3.1.8 and it gave me the error,

out of memory, need more space

Do you know how awk or gawk uses memory?

I'm running on an...
1,513
Posted By script_op2a
Internal software error in the tostring function for files greater than 300 MB
Hello,

When I run my awk script with input files greater than 300 MB I always get this error:

awk: Internal software error in the tostring function on...
6,137
Posted By script_op2a
awk: Internal software error in the tostring function on
Hello,

I posted a working script on this thread:

https://www.unix.com/emergency-unix-linux-support-help-me/160123-help-make-awk-script-more-efficient-large-files.html

When I run this script...
8,968
Posted By script_op2a
Help to make awk script more efficient for large files
Hello,

Error

awk: Internal software error in the tostring function on...
8,922
Posted By script_op2a
This is what I finally used: diff $outfile...
This is what I finally used:

diff $outfile $temp_sort_file |awk '/^>/ {print $0}'|sed 's/^> //' > $temp_dups_fileIt works with most of my files.

I'm trying to understand it.

What is the awk...
4,174
Posted By script_op2a
trying to accumulate a number in the same variable
Hello,

I trying to accumulate the same number in a variable:

#!/usr/bin/sh

infile="$1/$2"

if [[ ! -r $infile ]]
then
#echo "file is not readable: $infile"
exit 1
fi
...
2,088
Posted By script_op2a
need to get the total # of column for each line - NF not working
Hello,

I just need to print the # of columns for each line of the input file.
The input file uses the ascii 009 tab character.
I specify this character as the FS (field separator) in the BEGIN...
11,251
Posted By script_op2a
need to convert a decimal value to an ascii char with awk for the field delimiter
Hello,

I need an awk script to receive a variable that's an decimal value such as 009 or 031 and then convert this value to an ascii character to use as the FS (field separator for the input...
3,334
Posted By script_op2a
need to delete all lines from a group of files except the 1st 2 lines
Hello,

I have a group of text files with many lines in each file.

I need to delete all the lines in each and only leave 2 lines in each file.
1,976
Posted By script_op2a
need to read lines in file and compare value in if not working
Hello,

I have this file that sometime contains 0 lines and sometimes 1 or more.

It's supposed to then put the result (could be 0 or 1 or 2 or more) into a variable.

Then it's supposed to...
8,922
Posted By script_op2a
This almost works. The only problem is that it...
This almost works. The only problem is that it puts a blank space in front of every line in the unwanted_duplicates_records file.

Is there any way we can fix this?
8,922
Posted By script_op2a
Hello, Could anyone help me modify this...
Hello,

Could anyone help me modify this script to output 1 file containing the unwanted duplicates and the other containing just the desired records?
25,383
Posted By script_op2a
uname returns HP-UX what do you think of...
uname returns HP-UX

what do you think of that?

I was told we use the Korne shell but when I try to use the ksh path for shell scripts I get the little heart character appear on the line and it...
3,839
Posted By script_op2a
specified path name is too long passing parameters to awk via shell script
Hello,

I have this shell script that runs awk code by passing in parameters however now it doesn't work anymore with the parameters and I don't know why.

It removes duplicates from an input...
25,383
Posted By script_op2a
I was told that it's POSIX, similar to the Korn...
I was told that it's POSIX, similar to the Korn shell. That you could use:

#!/usr/bin/sh
or
#!/usr/bin/ksh


in the shell scripts but they seem to work differenly so I'm sticking to /sh
3,570
Posted By script_op2a
problem with print append to output file syntax
I'm trying to output the contents of the infile to the outfile using Append.
I will want to use append but the syntax doesn't seem to be working !
Input file (called a.txt) contains this:

a
a...
25,383
Posted By script_op2a
was told that we're using POSIX I removed...
was told that we're using POSIX

I removed the > before the infile

when I do it like this it works:

#!/usr/bin/sh

infile="$1/$2"

awk '{print $0;}' $infile
25,383
Posted By script_op2a
problem executing awk in shell "not found"
Hello,

The INPUT file a.txt contains this


a
a
a
b
b
b
I'm trying to execute this shell script from the Unix Command Line like this:

./k.sh a.txt > newfile.txt
#!/usr/bin/sh
...
Showing results 1 to 25 of 37

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