04-25-2010
Data selection
Hi,
I have a file containing details of different departments . Infomration of departments is in various tags
file is as below
Quote:
DEPTNUM 1|
FACULTY 20|
STUDENTS 300|
COURSES 3|
DEPTNUM 2|
FACULTY 25|
STUDENTS 500|
COURSES 30|
DEPTNUM 3|
FACULTY 22|
STUDENTS 600|
COURSES 31|
AND SO ON
I want to create a new file from the above file which should contain only two fields belonging to one department
format
Quote:
DEPTNUM,STUDENTS
1,50
2,500
3,600
There are multiple files containing department details of individiual college
I tried below
Quote:
for file in `ls -1 pwd`
do
var1=`grep DEPTNUM $file |cut -c 9`
var2=`grep STUDENTS $file |cut -c 10-12`
done
However it did not serve my purpose and not giving expected result
Please suggest some alternative solution
Many thanks in advance
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a question:
Y X
Tabel a is a array multidimensional --> a(1024,20)
I load in to array a Text from 6000 row where:
in a(1,1) is present the row 1 of original text, in a(1024,1) is present then row 1024 of original test and in... (4 Replies)
Discussion started by: ZINGARO
4 Replies
2. UNIX for Advanced & Expert Users
Hello All,
Could anyone help me how to selecting the trays in unix .
Thanks,
Amit kul (3 Replies)
Discussion started by: amit kul
3 Replies
3. Post Here to Contact Site Administrators and Moderators
Maybe I'm missing something but when I go to CP->Options, I see the box for selecting which forum to opt out of but no way to set it. (5 Replies)
Discussion started by: drhowarddrfine
5 Replies
4. Shell Programming and Scripting
I have a file like this
QUEUE: <ITEM(69)> "/NLA///ACHO_EQU_IDX"
Q_KEY: <ITEM(69)> "/NLA///ACHO_EQU_IDX"
Q_TYPE: <VSTR(32)> "GEN_VSTR_INDEX"
... (1 Reply)
Discussion started by: manas_ranjan
1 Replies
5. Shell Programming and Scripting
Hi,
Please note that as a programmer I cannot tell the file format or details of my production files so I have re-framed my file and taken a case of departments. Kindly guide as its related to a production requirement of data containing recors of production customer NOT A HOMEWORK :)
I have... (10 Replies)
Discussion started by: test_user
10 Replies
6. Shell Programming and Scripting
Hi All,
i have log file sample data is
2010/10/09|04:00:00.392|15Minute|BW=0|192.168.0.1
2010/10/08|04:00:00.392|15Minute|BW=0|192.168.0.1
2010/10/07|04:00:00.392|15Minute|BW=0|192.168.0.1
2010/10/05|04:00:00.392|15Minute|BW=0|192.168.0.1
2010/10/03|04:00:00.392|15Minute|BW=0|192.168.0.1... (2 Replies)
Discussion started by: posner
2 Replies
7. Shell Programming and Scripting
ok im kinda stuck i have a bash script with 4 options
1. Create Script
2. Show Script
3 . Delete script
4. Exithow would i use an if statement for this? im not sure what test command i would use.
I know it would be like this (below) to display the script
if
then cat script1or for the... (10 Replies)
Discussion started by: gangsta
10 Replies
8. Shell Programming and Scripting
I have a script:
#!/bin/ksh
runmqsc CERN.PROD <<EOF
dis chs(to.*)
end
EOF
which gives me the output as:
1 : dis chs(to.*)
AMQ8417: Display Channel Status details.
CHANNEL(TO.CGPRODAPP2) CHLTYPE(CLUSRCVR)
CONNAME(10.60.16.50) CURRENT
... (5 Replies)
Discussion started by: Daniel Gate
5 Replies
9. Shell Programming and Scripting
Hi,
I need some help taking a selection from a command and adding part of the output to an array.
I'd like to read the items into the array, have the user chose an option from the array and put the item from column 1 into a variable.
The command is:
awless -l list routetables --columns... (7 Replies)
Discussion started by: bignellrp
7 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I would like to upgrade my AIX box 6.1 to 7.1/7.2.
Current info of my AIX 6.1 box
/ > oslevel -s
6100-09-11-1810
System Model: IBM,9117-MMD
Machine Serial Number: xxx
Processor Type: PowerPC_POWER7
Processor Implementation Mode: POWER 7
Processor Version: PV_7_Compat
Number Of... (10 Replies)
Discussion started by: Phat
10 Replies
LEARN ABOUT DEBIAN
sge_access_list
ACCESS_LIST(5) Sun Grid Engine File Formats ACCESS_LIST(5)
NAME
access_list - Sun Grid Engine access list file format
DESCRIPTION
Access lists are used in Sun Grid Engine to define access permissions of users to queues (see queue_conf(5)) or parallel environments (see
sge_pe(5)). A list of currently configured access lists can be displayed via the qconf(1) -sul option. The contents of each enlisted
access list can shown via the -su switch. The output follows the access_list format description. New access lists can be created and exist-
ing can be modified via the -au and -du options to qconf(1).
Departments are a special form of access list that additionally allow assignment of functional shares and override tickets.
Note, Sun Grid Engine allows backslashes () be used to escape newline (
ewline) characters. The backslash and the newline are replaced
with a space (" ") character before any interpretation.
FORMAT
The following list of access_list parameters specifies the access_list content:
name
The name of the access list as defined for userset_name in sge_types(1).
type
The type of the access list, currently one of ACL, or DEPT or a combination of both in a comma separated list. Depending on this parame-
ter the access list can be used as access list only or as a department.
oticket
The amount of override tickets currently assigned to the department.
fshare
The current functional share of the department.
entries
The entries parameter contains the comma separated list of those UNIX users (see user_name in sge_types(1)) or those primary UNIX groups
that are assigned to the access list or the department. Only a user's primary UNIX group is used; secondary groups are ignored. Only sym-
bolic names are allowed. A group is differentiated from a user name by prefixing the group name with a '@' sign. Pure access lists allow
enlisting any user or group in any access list.
When using departments, each user or group enlisted may only be enlisted in one department, in order to ensure a unique assignment of jobs
to departments. To jobs whose users do not match with any of the users or groups enlisted under entries the defaultdepartment is assigned,
if existing.
SEE ALSO
sge_intro(1), sge_types(1), qconf(1), sge_pe(5), queue_conf(5).
COPYRIGHT
See sge_intro(1) for a full statement of rights and permissions.
SGE 6.2u5 $Date$ ACCESS_LIST(5)