This goes through the first file adding each line into an array. It keeps a count of each lines occurrence. NR is the "record number," or the line number being processed since the default record delimiter is a new line. FNR is record number for this file. So for the first file, the two match. For the next file, NR keeps counting upwards but FNR is reset. The 'next' will skip to the next record (and all the code below), because we're done and the code below is for our second file.
We're looking at our second file. We look to see if the line is matched with one in array (which holds all lines of first file). We decrease the count. If it's 0, we want to remove the "key" from the associative array, so that it's not looped through in the END statement's loop.
Since that last block had a 'next' inside the if, this is only executed if the line was not in the first file. list2output.csv is exclusive to list2.
What we have left in the array is put into list1output. What's left should be lines that appear in list1 more than they appear in list2.
hi all,
i am new to UNIX. this is my first time using Ubuntu. i need to do this for my fyp.
i am using an artificial neural network model to predict the yield strength of steel. the shell script used to execute this model is as shown here:
#Thomas Sourmail, Cambridge University /... (4 Replies)
:)
Hi,
I use the following command to search for a string in all the files in the directories and sub directories.
find . -type f -print | xargs grep bermun@cial.net
Can someone please cite a method wherin I can find the entries from a list of 300-500 *.gz files by modifying the above... (2 Replies)
Hi
this script adds text in the correct place on one line only, in a script.
awk 'BEGIN{
printf "Enter residue and chain information: "
getline var < "-"
split(var,a)
}
/-s rec:/{$7=a; }
{print}' FLXDOCK
but I need the same info added at position 7 on line 34 and... (1 Reply)
Hi,
I want to print specific columns (from 201 to 1001). The line that I am using is listed below. However I also want to print column 1. So column 1 and 201 to 1001. What modifcations do I need to make?
Code:
awk -F'\t' 'BEGIN {min = 201; max = 1001 }{for (i=min; i<=max; i++) printf... (5 Replies)
Hello everyone, I am currently doing a utility that acts like a cd command but keeps track of your change of directories.
What I plan to do is just to modify the cd source code, is that even possible? Can someone please help me with this?
I also need to incorporate the command with the... (3 Replies)
I have the records in the format
one row
0009714494919I MY010727408948010 NNNNNN N PUSAAR727408948010 R007YM08705 9602002 S 111+0360832-0937348
I want to get it int the format
0009714494919I MY010727408948010 NNNNNN N PUSAAR727408948010 R007YM08705 9602002 S ... (2 Replies)
I have the following awk script and I want to change it to be inside a condition for the file extension.
################################################################################
# abs: Returns the absolute value of a number
function abs(val) {
return val > 0 ? val \
... (4 Replies)
Hi,
I have following input in the file in which i want to club the entries based on $1. Also $11 is equal to $13 of other record(where $13 must be on higher side for any $1) then sum all other fields except $11 & $13. Final output required is as follows:
INPUTFILE:
... (11 Replies)
Hello
I am working on a Change request and Stuck at a point. The below awk command is used in the function.
float_test ( ) {
echo | awk 'END { exit ( !( '"$1"')); }'
}
I understand that awk 'END' is used to add one line at the end and exit is used to end the script with an error... (4 Replies)
I have found this syllable splitter in awk. The code is given below. Basically the script cuts words and names into syllables. However it fails when the word contains 2 consonants which constitute a single syllable. An example is given below
ashford
raphael
The output is as under:
... (4 Replies)
Discussion started by: gimley
4 Replies
LEARN ABOUT CENTOS
tzselect
TZSELECT(8) Linux System Administration TZSELECT(8)NAME
tzselect - select a timezone
SYNOPSIS
tzselect
DESCRIPTION
The tzselect program asks the user for information about the current location, and outputs the resulting timezone description to standard
output. The output is suitable as a value for the TZ environment variable.
All interaction with the user is done via standard input and standard error.
EXIT STATUS
The exit status is zero if a timezone was successfully obtained from the user, nonzero otherwise.
ENVIRONMENT
AWK Name of a Posix-compliant awk program (default: awk).
TZDIR Name of the directory containing timezone data files (default: /usr/share/zoneinfo).
FILES
TZDIR/iso3166.tab
Table of ISO 3166 2-letter country codes and country names.
TZDIR/zone.tab
Table of country codes, latitude and longitude, TZ values, and descriptive comments.
TZDIR/TZ
Time zone data file for timezone TZ.
SEE ALSO tzfile(5), zdump(8), zic(8)COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2007-05-18 TZSELECT(8)