Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Check Column corresponding to input Post 302833391 by newkid.7955 on Wednesday 17th of July 2013 04:33:11 AM
Old 07-17-2013
This is the sample of my txt file...
Code:
New York;ABC;145;Yes;YES;No
New York;BCD;113;Yes;YES;No
New York;NAS;63;Yes;YES;No
------------------------
London-48;CBT;16;Yes;YES;No
London-48;CME;17;Yes;YES;No
London-48;EUR;52;Yes;YES;No
London-48;EUR;188;Yes;YES;No
London-48;USx;66;Yes;YES;No
London-48;AMS;172<BR>178;Yes<BR>Yes;YES<BR>YES;no<BR>no
London-48;LIFE;172<BR>174<BR>178;Yes<BR>Yes<BR>Yes;YES<BR>YES<BR>YES;no<BR>no<BR>no
London-48;EUEd;175;Yes;YES;no
London-48;FOXN;177;Yes;YES;no
London-48;BIRD;177;Yes;YES;no
London-48;MOND;177;Yes;YES;no
London-48;EUI;174;Yes;YES;no
London-48;XEC;15;Yes;No;No
London-48;NYMC;15;Yes;No;No
-----------------------------
London-47;WBOx;28;Yes;YES;No
London-47;BCD;20;Yes;No;No
London-47;MCe;89;Yes;YES;No
London-47;DUBL;87;Yes;YES;No
London-47;CIHX;34;Yes;YES;No
London-47;Ctaf;203;Yes;No;No
London-47;LUXA;95;Yes;YES;No
London-47;LUXB;95;Yes;YES;No
London-47;LUXP;95;Yes;YES;No
London-47;NEBX;95;Yes;YES;No
London-47;NXEL;95;Yes;YES;No
London-47;misc;95;Yes;YES;No
London-47;BXNJ;95;Yes;YES;No
London-47;LANT;95;Yes;YES;No
London-47;LANB;95;Yes;YES;No
London-47;MASD;95;Yes;YES;No
London-47;BRUS;95;Yes;YES;No
London-47;LISB;95;Yes;YES;No
London-47;LIST;95;Yes;YES;No
London-47;PARF;95;Yes;YES;No
London-47;JSEB;31;Yes;YES;No
London-47;LoND;33;Yes;YES;No

It is in the format of Server;Country;Num;Data1;Data2;Data3

If there are multiple Num column, then it is in the format
Code:
Server;Country;<BR>Num1</BR><BR>Num2</BR>;Data1ofNum1<BR>Data1ofNum2;Data2ofNum1<BR>Data2ofNum2;Data3ofNum1<BR>Data3ofNum2


Last edited by Scott; 07-17-2013 at 10:05 AM.. Reason: Code tags, please...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

What can i do to check that the input is all alphabet.. ?

What can i do to check that the input is all alphabet.. ? (4 Replies)
Discussion started by: XXXXXXXXXX
4 Replies

2. Shell Programming and Scripting

Check on Input

HI all, I would like to know how the user can be restricted for entering only the number and not characters in sheel scripts.. Suppose code is like this echo 'Enter the number' read Value Now user may enter 'a' as value... But i want to disallow him for entering characters other than... (3 Replies)
Discussion started by: dhananjaysk
3 Replies

3. UNIX for Dummies Questions & Answers

check the input

how to check whether a given input is a number or a string? (1 Reply)
Discussion started by: Shilpi
1 Replies

4. Shell Programming and Scripting

How to check Null values in a file column by column if columns are Not NULLs

Hi All, I have a table with 10 columns. Some columns(2nd,4th,5th,7th,8th and 10th) are Not Null columns. I'll get a tab-delimited file and want to check col by col and generate seperate error code for each col eg:102 if 2nd col value is NULL and 104 if 4th col value is NULL so on... I am a... (7 Replies)
Discussion started by: Mandab
7 Replies

5. Programming

How to check an input variable

Suppose we have a simple situation, like the following C++ instructions: int x; cout << "Insert x: "; cin >> x; while ( x-- < 0 ) ; Of course, if it is written something different from an integer, the while loop shall not end. So, how can we check if the input x is of the right type? (2 Replies)
Discussion started by: Luke Bonham
2 Replies

6. Shell Programming and Scripting

Input file check

Hi, I have a script which runs daily. It gets 3 input files test1,test2,test3. I want to do a validation in my script to make sure i have all the 3 files available before running. If any one of the file is missing i want to break the script. Could you please help me with this request. ... (1 Reply)
Discussion started by: Krrishv
1 Replies

7. Shell Programming and Scripting

Check user input

Hi, I need my script to check if the user enters 3 values if not 5 values to my script and alert if the input has any other number of values. for example: ./myscript.sh 22 56 3221 - > correct ./myscript.sh 22 56 3221 45 777 -> correct ./myscript.sh 22 56 3221 45 -> incorrect Please... (6 Replies)
Discussion started by: mohtashims
6 Replies

8. Shell Programming and Scripting

Check whether input is numeric

Hello there, find below for my code first: $pdp_asaba=`cat /tmp/temp_total | grep asaba | sed 's/*//g'` if ]] then pdp_asaba=0 fi $pdp_abuja=`cat /tmp/temp_total | grep abuja | sed 's/*//g'` if ]] then pdp_abuja=0 fi $pdp_ojota=`cat /tmp/temp_total | grep ojota | sed 's/*//g'` if ... (3 Replies)
Discussion started by: infinitydon
3 Replies

9. Shell Programming and Scripting

Check first column - average second column based on a condition

Hi, My input file Gene1 1 Gene1 2 Gene1 3 Gene1 0 Gene2 0 Gene2 0 Gene2 4 Gene2 8 Gene3 9 Gene3 9 Gene4 0 Condition: If the first column matches, then look in the second column. If there is a value of zero in the second column, then don't consider that record while averaging. ... (5 Replies)
Discussion started by: jacobs.smith
5 Replies

10. Shell Programming and Scripting

Search last column of INPUT.txt in TABLEs text and add correspond columns to INPUT.txt

Hi dears i use bash shell i have INPUT.txt like this number of columns different in one some row have 12 , some 11 columns see last column INPUT.txt CodeGender Age Grade Dialect Session Sentence Start End Length Phonemic Phonetic 63 M 27 BS/BA TEHRANI 3 4 298320 310050... (2 Replies)
Discussion started by: alii
2 Replies
Datebook(3pm)						User Contributed Perl Documentation					     Datebook(3pm)

NAME
Palm::Datebook - Handler for Palm DateBook and Calendar databases. SYNOPSIS
use Palm::Datebook; DESCRIPTION
The Datebook PDB handler is a helper class for the Palm::PDB package. It parses DateBook and Calendar databases. AppInfo block The AppInfo block begins with standard category support. See Palm::StdAppInfo for details. Sort block $pdb->{sort} This is a scalar, the raw data of the sort block. Records $record = $pdb->{records}[N] $record->{day} $record->{month} $record->{year} The day, month and year of the event. The day and month start at 1 (i.e., for January, "$record->{month}" is set to 1). The year is a four- digit number (for dates in 2001, "$record->{year}" is "2001"). For repeating events, these fields specify the first date at which the event occurs. $record->{start_hour} $record->{start_minute} $record->{end_hour} $record->{end_minute} The start and end times of the event. For untimed events, all of these are 0xff. $record->{when_changed} This is defined and true iff the "when info" for the record has changed. I don't know what this means. $record->{alarm}{advance} $record->{alarm}{unit} If the record has an alarm associated with it, the %{$record->{alarm}} hash exists. The "unit" subfield is an integer: 0 for minutes, 1 for hours, 2 for days. The "advance" subfield specifies how many units before the event the alarm should ring. e.g., if "unit" is 1 and "advance" is 5, then the alarm will sound 5 hours before the event. If "advance" is -1, then there is no alarm associated with this event. New records created via "new_Record" have a 10 minute alarm set by default. "undef $record->{alarm}" to remove this alarm before writing. An alarm icon will still show up in the Datebook if the "alarm" field exists, even with "advance" set to -1. %{$record->{repeat}} This exists iff this is a repeating event. $record->{repeat}{type} An integer which specifies the type of repeat: 0 no repeat. 1 a daily event, one that occurs every day. 2 a weekly event, one that occurs every week on the same day(s). An event may occur on several days every week, e.g., every Monday, Wednesday and Friday. For weekly events, the following fields are defined: @{$record->{repeat}{repeat_days}} This is an array of 7 elements; each element is true iff the event occurs on the corresponding day. Element 0 is Sunday, element 1 is Monday, and so forth. $record->{repeat}{start_of_week} Day the week starts on (0 for Sunday, 1 for Monday). This affects the phase of events that repeat every 2nd (or more) Sunday. 3 a "monthly by day" event, e.g., one that occurs on the second Friday of every month. For "monthly by day" events, the following fields are defined: $record->{repeat}{weeknum} The number of the week on which the event occurs. 0 means the first week of the month, 1 means the second week of the month, and so forth. A value of 5 means that the event occurs on the last week of the month. $record->{repeat}{daynum} An integer, the day of the week on which the event occurs. 0 means Sunday, 1 means Monday, and so forth. 4 a "monthly by date" event, e.g., one that occurs on the 12th of every month. 5 a yearly event, e.g., one that occurs every year on December 25th. $record->{repeat}{frequency} Specifies the frequency of the repeat. For instance, if the event is a daily one, and $record->{repeat}{frequency} is 3, then the event occurs every 3 days. $record->{repeat}{unknown} I don't know what this is. $record->{repeat}{end_day} $record->{repeat}{end_month} $record->{repeat}{end_year} The last day, month and year on which the event occurs. @{$record->{exceptions}} $day = $record->{exceptions}[N][0] $month = $record->{exceptions}[N][1] $year = $record->{exceptions}[N][2] If there are any exceptions to a repeating event, e.g. a weekly meeting that was cancelled one time, then the @{$record->{exceptions}} array is defined. Each element in this array is a reference to an anonymous array with three elements: the day, month, and year of the exception. $record->{description} A text string, the description of the event. $record->{location} A text string, the location (if any) of the event (Calendar database only). $record->{note} A text string, the note (if any) attached to the event. %{$record->{timezone}} This exists iff a time zone has been set for the event. $record->{timezone}{name} The time zone name, e.g., "London" or "San Francisco". $record->{timezone}{country} The country the time zone is in. This is an integer defined in Core/System/PalmLocale.h. $record->{timezone}{offset} This gives the offset from UTC, in minutes, of the time zone. $record->{timezone}{dst_adjustment} This gives the additional offset while daylight savings time is in effect. The offset from UTC is $record->{timezone}{offset} + $record->{timezone}{dst_adjustment} (actually only 0 or 60 are used). $record->{timezone}{custom} Should indicate whether this location was created by the user, though this always seems to be true. $record->{timezone}{flags} Reserved flags. $record->{timezone}{start_hour} $record->{timezone}{start_daynum} $record->{timezone}{start_weeknum} $record->{timezone}{start_month} $record->{timezone}{end_hour} $record->{timezone}{end_daynum} $record->{timezone}{end_weeknum} $record->{timezone}{end_month} These define the period during which daylight savings time is in effect if $record->{timezone}{dst_adjustment} is non-zero. daynum specifies the day of week (0=Sunday, 6=Saturday) and weeknum specifies the week of month (0=1st, 3=4th, 4=last), analagously to the "monthly by day" repeating event. e.g., The "London" time zone has DST starting on the last Sunday of March, which is indicated with start_daynum=0 (Sunday), start_weeknum=4 (last week of the month), and start_month=3 (March). METHODS
new $pdb = new Palm::Datebook; $pdb = new Palm::Datebook({app => 'Calendar'}); Create a new PDB, initialized with the various Palm::Datebook fields and an empty record list. Creates a Datebook PDB by default. Specify the app parameter as 'Calendar' to create a Calendar PDB. new_Record $record = $pdb->new_Record; Creates a new Datebook record, with blank values for all of the fields. "new_Record" does not add the new record to $pdb. For that, you want "$pdb->append_Record". SOURCE CONTROL
The source is in Github: http://github.com/briandfoy/p5-Palm/tree/master AUTHOR
Alessandro Zummo, "<a.zummo@towertech.it>" Currently maintained by brian d foy, "<bdfoy@cpan.org>" SEE ALSO
Palm::PDB(3) Palm::StdAppInfo(3) perl v5.10.1 2010-02-23 Datebook(3pm)
All times are GMT -4. The time now is 08:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy