The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Document management with Epiware iBot UNIX and Linux RSS News 0 09-04-2008 12:10 PM
NOAH Document Management System 3.2.2 (Default branch) iBot Software Releases - RSS News 0 08-18-2008 05:30 PM
PolDoc Document Management System: Version 0.9642 released iBot Software Releases - RSS News 0 07-12-2008 06:30 PM
Epiware Document Management 4.8.5 (Default branch) iBot Software Releases - RSS News 0 01-12-2008 07:10 AM
NOAH Document Management System 3.2.1 (Default branch) iBot Software Releases - RSS News 0 01-02-2008 05:00 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-09-2009
rmuledeer rmuledeer is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 5
Shell Scripted Document Management System

Over the past 4 -5 years, I have cobbled together a rudimentary 'Document Management System' for a school district I support using Linux Bash Shell scripts..

The purpose of the scripting was to supplement features of a Job Applicant Center that had very simplistic methods of handle file attachments.

They are in process of upgrading to a new revision of the software and the new version uses a database table on the backup to index documents available for viewing on the Web Management viewer.

The "district" has a scanning process that runs outside the package.. (as the software package is a Job Applicant Center) scanning was not taken into consideration..

What we have defined is a "STAGED LOCATION"

Each file in this staging area will have a consistent named value, but there is no way at scanning time to check the database content.
TABLE FIELDS
FIELD1:<DOCID>
FIELD2:<ITERID>
FIELD3:<DOCID>
FIELD4:<{DESCRIPTIVE}&{STORENAME}>
FIELD5: <STORENAME>

The 1st Field is created when an Applicant applies for a Job and attaches a resume to the application.

The 2nd field is a system constant of "O" (zero)

The 5th Field is a concatenation
<APPID>_<ITERID>_<DOCID>.ext

The 4th Field <{DESCRIPTIVE}&{STORENAME}>
is a concatenation of the other strings plus a descriptive of the contents of the file placed there by the person doing the scanning.

The "DOCID" (Field 3) is my problem:


For example:
1. LOR1_1234_0_1.ext
For Letter of Reference
2. TRANSCRIPT_1234_0_1.ext
For College Transcripts

I've been able to reach a point where I need to check the values of staged files against the values in the database. the VALUE OF DOCID needs to be "6 or GREATER" so the Applicant not view these files from the web as they can see the 1st five files.


---## keep in mind this is test data only ignore ##



DATABASE VALUES
177|0|1|Resume-Joe-Jones.doc|177_0_1.doc|
177|0|2|Joe Jones Letter of Introduction.doc|177_0_2.doc|
55|0|1|DebSmith-Resume.doc|55_0_1.doc|
55|0|2|DebSmith IntroLetter.pdf|55_0_2.pdf|
5996|0|1|Sarah_Palin-Resume.doc|5996_0_1.doc|
5996|0|6|References_5996_0_1.doc|5996_0_6.doc|


the District Scans in information on to PDF or Word Documents and places then in a STAGING AREA for EACH applicant with the file naming convention:
STAGED DOCUMENTS
<DESC>_<APPID>_<ITERID>_<DOCID>.ext
LOR1_177_0_1.doc
LOR2_177_0_2.doc
LOR1_55_0_1.doc
TRANSCRIPT_55_0_1.pdf
LOR1_5996_0_1.doc
TRANSCRIPT_5996_0_2.doc

I need to take the documents in this staging area build an insert file to check values in the table.
the key fields at "DOCID" "APPID" and
"STORENAME" I need to increment in the SARAH PALIN STAGED FILE:
TRANSCRIPTS_5996_0_1.doc
and build a record to insert into the database looking like this
5996|0|7|TRANSCRIPTS_5996_0_1.doc|5996_0_7.doc|

Since the "DOCID" FOR APPID 5996 already is valued at "6" I increment by 1. If the value in the table is Less then 6 or is null the value would be "6"

So when I am done with the script the values in the TABLE FOR APPID 5996 should look like this:

5996|0|1|Sarah_Palin-Resume.doc|5996_0_1.doc|
5996|0|6|References_5996_0_1.doc|5996_0_6.doc|
5996|0|7|TRANSCRIPTS_5996_0_1.doc|5996_0_7.doc|




In my previous script I would move off any scanned items to a backup location, and new files would receive a "counter"

while [[ -f ${distpath}${appID}/${distID}_${appID}_${docID}.${ext} ]]
do
(( docID += 1 ))
if (( docID > 99 )); then
echo "ERROR: docID too high!"
exit 2
fi
done

I essential need to do the same thing except against the check file from the database...
Attached Files
File Type: sh jacfmt.sh (2.3 KB, 20 views)

Last edited by rmuledeer; 02-09-2009 at 03:29 PM..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:40 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0