10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a huge file (50 Mil rows) which has certain non-printable ASCII characters in it. I am cleaning the file by deleting those characters using the following command -
tr -cd '\11\12\15\40-\176' < unclean_file > clean_file
Please note that I am excluding the following -
tab,... (6 Replies)
Discussion started by: rishigc
6 Replies
2. Shell Programming and Scripting
Hi.. i am running nawk scripts on solaris system to get records of file1 not in file2 and find duplicate records in a while with the following scripts -compare
nawk 'NR==FNR{a++;next;} !a {print"line"FNR $0}' file1 file2duplicate - nawk '{a++}END{for(i in a){if(a-1)print i,a}}' file1in the middle... (12 Replies)
Discussion started by: Abhiraj Singh
12 Replies
3. Shell Programming and Scripting
nawk '{ fmt="%3s %22s %48s %35s %21s\n"; if ($3==$6 && $1=="STOPLOSS") { tpy="Successful Match"; jnme=$1; sts="File will be loaded"; cntrl=$3; audit=$6; printf (fmt, tpy,jnme,sts,cntrl,audit) >> "'${AUDIT_DATA_FILE}/${AUDIT36}'" }else if ($3!=$6 && $1=="STOPLOSS") { tpy="Mis-Match ";... (4 Replies)
Discussion started by: wawa
4 Replies
4. Shell Programming and Scripting
I have a simple bash script that prints sth every 5 seconds. What I do is the following. I redirect the output of the script to a file, tail the file and see that it works and then from another console I delete the file where the output is redirected to. Even though I have deleted the file, the... (2 Replies)
Discussion started by: igurov
2 Replies
5. Shell Programming and Scripting
Hi Gurus,
I am struggling with nawk command where i am processing a file based on columns.
Here is the sample data file.
UM113570248|24-AUG-11|4|man1|RR211 Alert: Master Process failure |24-AUG-11
UM113570624|24-AUG-11|4|man1| Alert: Pattern 'E_DCLeDAOException' found |24-AUG-11... (7 Replies)
Discussion started by: usha rao
7 Replies
6. Shell Programming and Scripting
Good Morning/Afternoon All,
I am having some trouble creating a variable called "total" to display the sum of the values in a specific field, $6 for example.
The data I am working on is in the following form:
John Doe:(555) 555-5555:1:2:3
Jane Doe:(544) 444-5556:4:5:6
Moe Doe:(654)... (2 Replies)
Discussion started by: SEinT
2 Replies
7. Shell Programming and Scripting
A file file1.txt exists having records like
The delimiter being "|"
X|_|Y|_|Z|_| (number of fields 7)
A|_|B|_| (number of fields 5)
X|_|Z|_|H|_| (number of fields 7)
A|_|D|_|S|_| (number of... (4 Replies)
Discussion started by: centurion_13
4 Replies
8. Shell Programming and Scripting
Example CSV:
$ cat myfile
HDR
COL_A,COL_B,COL_C
X,Y,Z
Z,Y,X
...
X,W,Z
In this example, I know that column names are on the second line. I also know that I would like to print lines where COL_A="X" and COL_C="Z". In this simple example, I know that COL_A = $1 and COL_C = $3, and hence... (6 Replies)
Discussion started by: cs03dmj
6 Replies
9. Shell Programming and Scripting
% ls -ld /usr /foo
ls: /foo: No such file or directory
drwxr-xr-x 14 root wheel 512 May 18 02:49 /usr
% ls -ld /usr /foo 1>/dev/null/
/dev/null/: Not a directory.
% ls -ld /usr /foo 2>/dev/null/
/dev/null/: Not a directory.
^^Why why why doesn't this work for me. Furthermore, where is... (7 Replies)
Discussion started by: phpfreak
7 Replies
10. Shell Programming and Scripting
How are ya,
Heres the problem.
I have a line of data that can either be in this format.
"20" or
"20kg"
for the 20kg one i need to be able to read that their is kg on the end of this field and then ignore it and move on to the next line. Can anyone help.
Cheers (3 Replies)
Discussion started by: ben_shark
3 Replies