Sponsored Content
Top Forums Shell Programming and Scripting Script to perform record format checks Post 302427656 by gsjdrr on Monday 7th of June 2010 11:17:52 AM
Old 06-07-2010
Thanks for your quick response.

I tried your code

PHP Code:
 awk -F'|' '{s=s$1} END{print s;gsub(/AB*C/,"",s);if(s=="")print "Syntax OK"; else print "Syntax Error"}' samplefile.dat
awk
syntax error near line 1
awk
illegal statement near line 1 


---------- Post updated at 10:17 AM ---------- Previous update was at 10:11 AM ----------

Thanks durden_tyler for perl code. Unfortunately, I am not supposed to use perl .
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perform some checks on file using perl

hi i want check for PVCS header in file if its present then check if its in proper format or not i want to do this is in perl on windows. this is what i am doing : 1 . open file 2 . check for "PVCS information" if found then store the line no to $line var. 3 . check for "sccs" header ... (0 Replies)
Discussion started by: zedex
0 Replies

2. Shell Programming and Scripting

to perform checks line by line on a file

Hi, I have a file abc.txt with data like this 1 /test/ 2 /test/file.txt 3 /data/ 4 /data/file1.txt 5 /data/file2.txt I want to take out every path from the file and check if its a directory or file. I am trying it with cut with something like this but it doesnt work ... (7 Replies)
Discussion started by: muaz
7 Replies

3. Shell Programming and Scripting

Shell scripts for record Re format

I have few files from windows which are tab delimited or ‘|' delimited files. I need to convert these files without any delimiter ( so in a way it would become variable length with no delimiter ) Can someone help me with the command in bourne shell scripts., ( I am trying with awk ) Thanks In... (6 Replies)
Discussion started by: Shanks
6 Replies

4. Shell Programming and Scripting

[Bash] MD5 Checks with Script.

Hi. I'm triyng to make a Bash Script that checks (recursively) the MD5 from all the files in a certain directory and compare them against some other check that should be already done and saved in a file. I've reached to the point where i have the MD5 from the file and the MD5 that the script... (1 Reply)
Discussion started by: BiFo
1 Replies

5. Shell Programming and Scripting

counting particular record format in a file using AWK

I am trying to count records of particular format from a file and assign it to a variable. I tried below command br_count=wc -l "inputfile.dat"| awk -F"|" '{if (NF != "14") print }' but I amnot able to get it done. Please share me some idea how to get it done. Thanks in advance (7 Replies)
Discussion started by: siteregsam
7 Replies

6. Shell Programming and Scripting

Script to performs checks

Hi , I need a script which performs below activity I have one file named "testfile" in 9 different directories with same name. I want to perform below action with each testfile of each directory. if ; then mv listfiles listfiles_`date +%b%y` else echo No Such files fi ... (4 Replies)
Discussion started by: sv0081493
4 Replies

7. Shell Programming and Scripting

Script to do the following checks

Hi , I need a script for processing below scenario. I have to check daily by doing ftp IP to check it is logging or not. So i want this activity to be automated such that if login succesful i will get "FTP LOGIN SUCCESS" in a log file and if fails i want the error message in the same log... (1 Reply)
Discussion started by: sv0081493
1 Replies

8. Shell Programming and Scripting

Script function which checks if itself is already running

Hi All, I have a cron job set up which is set to run every 10 seconds. What I need to do is have the script do a check to see if it is already running such that if it is running it wont fire up additional instances and processes according to its normal process. For example if I have a script... (4 Replies)
Discussion started by: landossa
4 Replies

9. UNIX for Dummies Questions & Answers

Help! needed to displaying an output in record format

Hi Friends, Am new to Unix world and this is my first post in this forum. I was stuck in displaying the content. while displaying the content the below points to be taken care 1 ) The header format is repeating 2) To display the value in table format... (2 Replies)
Discussion started by: rocky2013
2 Replies

10. Shell Programming and Scripting

Extract timestamp from first record in xml file and it checks if not it will replace first record

I have test.xml <emp><id>101</id><name>AAA</name><date>06/06/14 1811</date></emp> <Join><id>101</id><city>london</city><date>06/06/14 2011</date></join> <Join><id>101</id><city>new york</city><date>06/06/14 1811</date></join> <Join><id>101</id><city>sydney</city><date>06/06/14... (2 Replies)
Discussion started by: vsraju
2 Replies
SVN::Hooks::Generic(3pm)				User Contributed Perl Documentation				  SVN::Hooks::Generic(3pm)

NAME
SVN::Hooks::Generic - Implement generic checks for all Subversion hooks. VERSION
version 1.19 SYNOPSIS
This SVN::Hooks plugin allows you to easily write generic checks for all Subversion standard hooks. It's deprecated. You should use the SVN::Hooks hook defining exported directives instead. This module is configured by the following directive. GENERIC(HOOK => FUNCTION, HOOK => [FUNCTIONS], ...) This directive associates FUNCTION with a specific HOOK. You can make more than one association with a single directive call, or you can use multiple calls to make multiple associations. Moreover, you can associate a hook with a single function or with a list of functions (passing them as elements of an array). All functions associated with a hook will be called in an unspecified order with the same arguments. Each hook must be associated with functions with a specific signature, i.e., the arguments that are passed to the function depends on the hook to which it is associated. The hooks are specified by their standard names. The function signatures are the following: post-commit(SVN::Look) post-lock(repos-path, username) post-revprop-change(SVN::Look, username, property-name, action) post-unlock(repos-path, username) pre-commit(SVN::Look) pre-lock(repos-path, path, username, comment, steal-lock-flag) pre-revprop-change(SVN::Look, username, property-name, action) pre-unlock(repos-path, path, username, lock-token, break-unlock-flag) start-commit(repos-path, username, capabilities) The functions may perform whatever checks they want. If the checks succeed the function must simply return. Otherwise, they must die with a suitable error message, which will be sent back to the user performing the Subversion action which triggered the hook. The sketch below shows how this directive could be used. sub my_start_commit { my ($repo_path, $username, $capabilities) = @_; # ... } sub my_pre_commit { my ($svnlook) = @_; # ... } GENERIC( 'start-commit' => &my_start_commit, 'pre-commit' => &my_pre_commit, ); AUTHOR
Gustavo L. de M. Chaves <gnustavo@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by CPqD. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-24 SVN::Hooks::Generic(3pm)
All times are GMT -4. The time now is 09:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy