urgent help need with file matching script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting urgent help need with file matching script
# 1  
Old 05-21-2008
urgent help need with file matching script

hi,

Please help me!. I need a script that can read
the incoming text (say from a text file) and match few templates.

templates will look like

template 1

city Name:
zip code:
state Name:

template2:

employee Name:
Phone number:


my text file will look like

city Name: Harrison
zip code: 07029
state Name: NJ

here only one city name, zip code & state name will be present.

my script should find if the given text is compliant with template1 or template2...

I appreciate your time and help
# 2  
Old 05-21-2008
What have you tried so far?
# 3  
Old 05-21-2008
I have not started the script, I am looking for good iterative process that can handle this search process. I have few ideas

1) Grep for all variables (city name ..zip code etc..) in the given file,collect them and match them to each template .

2) formulate a general expression for a whole line and loop it till the end of the file.

I am looking for a good logic to start off.
# 4  
Old 05-21-2008
PHP same question again.

looks to be related to similar question...

https://www.unix.com/shell-programmin...#post302197741
# 5  
Old 05-21-2008
Yes, it is.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script example to Grep matching word from file

Hi expert, Need help in shell script. a.txt file output is below i would like to grep 3 line and 1st column value which is admin\22226 only and not full line. i only know admin word as 22226 can come anything with admin\ in file. also after fetching it i would like to use this... (1 Reply)
Discussion started by: kuljeetpal
1 Replies

2. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies

3. Shell Programming and Scripting

Shell script to filter records in a zip file that contains matching columns from another file

Not sure if this is the correct forum for this question. I have two files. file1.zip, file2 Input: file1.zip col1, col2 , col3 a , b , 0:0:0:0:0:c436:9346:d40b x, y, 0:0:0:0:0:880:39f9:c9a7 m, n , 0:0:0:0:0:80c7:9161:fe00 file2.txt col1 c4:36:93:46:d4:0b... (1 Reply)
Discussion started by: anil.v
1 Replies

4. UNIX for Dummies Questions & Answers

very urgent..need of a script which finds a file without the use of find command..hlp

im a beginner in shell scripting and i need a script which will find a file in a given path without the use of find or grep command.......i need some kind of code.....plzzz plzzzz help me......ive tried n searched every where but i couldn't find the solution for my particular problem..... (4 Replies)
Discussion started by: mishi
4 Replies

5. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

6. Shell Programming and Scripting

Pattern Matching Count Urgent

The input is like NO Code 030019991 22 030087819 0 030089001 22 030178901 39 030333333 22 Patterns i want to match is 0300 0301 0303. i want to count different Codes occurances for each of these pattern. for example for 0300 Code 22... (6 Replies)
Discussion started by: krabu
6 Replies

7. Shell Programming and Scripting

Calling an Executable C file from the script (URGENT HELP PLX ! )

hi i'm trying to use tcl/tk on unix machine to call an executable C file .. i am trying just a simple button like this one button .list -text "LIST" -command filename pack .list -padx 10 -pady 10 but its giving me error message when i save it in a file eg script.tcl the button is... (7 Replies)
Discussion started by: phantom308
7 Replies

8. Shell Programming and Scripting

Script to find file name for non matching pattern

Hi, I want to list only the file names which do not contain a specific keyword or search string. OS: Solaris Also is there any way ; through the same script I can save the output of search to a CSV (comma seperated) so that the file can be used for inventory purpose. Any assistance will... (5 Replies)
Discussion started by: sujoy101
5 Replies

9. Shell Programming and Scripting

urgent-extracting block data from flat file using shell script

Hi, I want to extract block of data from flat file. the data will be like this start of log One two three end of log i want all data between start of log to end of log i.e One two three to be copied to another file. This particular block may appear multiple times in same file. I... (4 Replies)
Discussion started by: shirish_cd
4 Replies

10. Shell Programming and Scripting

Urgent: selecting unique specific content of a file using shell script

Hi, I have a file whose content and format at places is as given below. print coloumn .... coloumn .... coloumn .... skip 1 line print coloumn ... skip 1 line I need to select the following : print coloumn .... coloumn .... coloumn... (2 Replies)
Discussion started by: jisha
2 Replies
Login or Register to Ask a Question