Sponsored Content
Top Forums Shell Programming and Scripting Parsing fields from class list files to use output with newusers command Post 302602195 by crimputt on Sunday 26th of February 2012 09:19:29 PM
Old 02-26-2012
Parsing fields from class list files to use output with newusers command

Hello I am trying to develop a shell script that takes a text file such as this...

Code:
E-mail@ Soc.Sec.No. *--------Name-----------* Class *School.Curriculum.Major.* Campus.Phone
JCC2380 XXX-XX-XXXX CAREY, JULIE C            JR-II BISS CPSC BS   INFO TECH   412/779-9445 
JAC1936 XXX-XX-XXXX CONSOLMAGNO, JOE A.       SO-I  BISS CPSC BS   INFO TECH   412/833-7993 
ACC4636 XXX-XX-XXXX CURRIE, ADAM C.           JR-II BISS CPSC BS   COMP SCI    724/657-0437 
SPF1696 XXX-XX-XXXX FARLEY, SEAN P.           JR-I  BISS CPSC BS   COMP SCI    814/236-2398 
SEK8835 XXX-XX-XXXX KELLEY, SHAWN E.          FR-II BISS CPSC BS   COMP SCI    724/406-7149 
MCK0599 XXX-XX-XXXX KOMISIN, MICHAEL C.       JR-I  BISS CPSC BS   COMP SCI    000/000-0000 
GJM1887 XXX-XX-XXXX MACK, GREGORY J.          SO-II BISS CPSC BS   INFO TECH   724/735-4354 
NGM5479 XXX-XX-XXXX MCINTIRE, NICHOLAS G      JR-I  BISS CPSC BS   INFO TECH   724/794-8268 
ZTP7190 XXX-XX-XXXX PETAK, ZACHARY T.         FR-II BISS CPSC BS   INFO TECH   724/406-1298 
AXS9097 XXX-XX-XXXX SAUNDERS, ALEXANDER       SO-I  BISS CPSC BS   INFO TECH   724/334-0313 
RJS6624 XXX-XX-XXXX SNYDER, ROBERT J.         SO-II BISS CPSC BS   COMP SCI    814/328-2021 
MWS1990 XXX-XX-XXXX STASNY, MATTHEW W         SO-II BISS CPSC BS   INFO TECH   412/882-0581

from the command line and then the output would be the <i>usernameSmilieassword</i>

The user name is the email name but it must be lowercase instead of uppercase, and the password is the first letters class, school, curriculum and major followed by the last 4 digits of the user's phone number.

The output of should look something like this...

Code:
jcc2380:jbci9445
jac1936:sbci7993

I am using the output with the newusers command to create new accounts in our system, but I am not very good with my parsing to produce this output


Many thanks,
Crim
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

parsing output from ls command

I have to test the directory name which is obtained from for dir in `ls -l|grep $9 ' i need to check whether it is directory ( if yes, I have to check the first 3 character fo the directory how can I do that? Please help me thanks (3 Replies)
Discussion started by: ajaya
3 Replies

2. Shell Programming and Scripting

parsing output from a diff command...

hi, i have a script which pipes the output of a diff -rq command into a separate file/ it would read something like this: Files mod1/lala/xml/test1.txt and mod2/lala/xml/test1.txt differ Only in mod2/lala/xml: test2.txt What i need to do is to parse this file so i end up with just a... (5 Replies)
Discussion started by: kam
5 Replies

3. Shell Programming and Scripting

How list of files apart from *.class files in certain folder

Hi Friends How to list of all files in a particular directory structure, with out listing a particular file extn. I mean to say in a folder structure I have many files ..I want to list them with out *.class files. Please help Thanks Joy (3 Replies)
Discussion started by: itsjoy2u
3 Replies

4. Shell Programming and Scripting

To get an output by combining fields from two different files

Hi guys, I couldn't find solution to this problem. If anyone knows please help me out. your guidance is highly appretiated. I have two files - FILE1 has the following 7 columns ( - has been added to make columns visible enough else columns are separated by single space) 155.34 - leg - 1... (8 Replies)
Discussion started by: smriti_shridhar
8 Replies

5. Shell Programming and Scripting

Parsing dynamic data from a command output

Hi people, I am writing a korn shell script, and one of the command gives an output something like below: release.label.2010.03.02 objects: /project/path/to/some/file_name.ksh /project/path/another/file_name01.dat I have to retrieve the file paths one by one & use them as... (9 Replies)
Discussion started by: kiwin1000
9 Replies

6. Shell Programming and Scripting

AWK Compare files, different fields, output

Hi All, Looking for a quick AWK script to output some differences between two files. FILE1 device1 1.1.1.1 PINGS device1 2.2.2.2 PINGS FILE2 2862 SITE1 device1-prod 1.1.1.1 icmp - 0 ... (4 Replies)
Discussion started by: stacky69
4 Replies

7. Shell Programming and Scripting

list files command output

Hi All, Below is the 2 different ouputs of the command "ls -lrt", my question is what exactly "total 0" & "total 8" means here ? $ ls -rtl total 0 -rw-r--r-- 1 oracle dba 0 Feb 10 20:16 c -rw-r--r-- 1 oracle dba 0 Feb 10 20:16 b -rw-r--r-- 1... (1 Reply)
Discussion started by: kannan84
1 Replies

8. Shell Programming and Scripting

Help: Parsing a file to new output files

I have an output file similar to this >HWI-ST766:129:D0WJDACXX:4:2308:16645:199681.1 /start=1 /end=100 /strand=+ Eukaryotic18S_rRNA GATTAAGCCATGCATGTGTAAGTTTAAAGTCCTAGAAGGATGAAACTGCGGACGGCTCAT TATAACAGTAATAGTTTCTTTGGTTAGTATCTATAAGGAT >HWI-ST766:129:D0WJDACXX:4:2308:2922:199946.1 /start=1... (4 Replies)
Discussion started by: fozrun
4 Replies

9. Shell Programming and Scripting

Parsing through list of files

I have a requirement where I need parse through files in a directory which have a specific pattern and then check whether the file has been processed or not. The exit condition is any file that has been processed will have an entry in database. If it is processed i.e., if an entry is present for... (4 Replies)
Discussion started by: abhilashnair
4 Replies

10. UNIX for Beginners Questions & Answers

Is there a UNIX command that can compare fields of files with differing number of fields?

Hi, Below are the sample files. x.txt is from an Excel file that is a list of users from Windows and y.txt is a list of database account. $ head -500 x.txt y.txt ==> x.txt <== TEST01 APP_USER_PROFILE USER03 APP_USER_PROFILE TEST02 APP_USER_EXP_PROFILE TEST04 APP_USER_PROFILE USER01 ... (3 Replies)
Discussion started by: newbie_01
3 Replies
PAPS(1) 						      General Commands Manual							   PAPS(1)

NAME
paps - UTF-8 to PostScript converter using Pango SYNOPSIS
paps [options] files... DESCRIPTION
paps reads a UTF-8 encoded file and generates a PostScript language rendering of the file. The rendering is done by creating outline curves through the pango ft2 backend. OPTIONS
These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. --landscape Landscape output. Default is portrait. --columns=cl Number of columns output. Default is 1. --font=desc Set the font description. Default is Monospace 12. --rtl Do rtl layout. --paper ps Choose paper size. Known paper sizes are legal, letter, a4. Default is A4. --bottom-margin=bm Set bottom margin in postscript points (1/72 inch). Default is 36. --top-margin=tm Set top margin. Default is 36. --left-margin=lm Set left margin. Default is 36. --right-margin=rm Set right margin. Default is 36. --help Show summary of options. --header Draw page header for each page. --markup Interpret the text as pango markup. --encoding=ENCODING Assume the documentation encoding is ENCODING. --lpi Set the lines per inch. This determines the line spacing. --cpi Set the characters per inch. This is an alternative method of specifying the font size. --stretch-chars Indicates that characters should be stretched in the y-direction to fill up their vertical space. This is similar to the texttops behaviour. AUTHOR
paps was written by Dov Grobgeld <dov.grobgeld@gmail.com>. This manual page was written by Lior Kaplan <kaplan@debian.org>, for the Debian project (but may be used by others). April 17, 2006 PAPS(1)
All times are GMT -4. The time now is 09:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy