Sponsored Content
Top Forums Shell Programming and Scripting parsing data file picking out certain fields Post 302171997 by timj123 on Saturday 1st of March 2008 07:07:25 PM
Old 03-01-2008
Can someone check my code below and help me fix? I can't seem to get this right. I am stuck, any help in making this easier for me, I would really appreciate it.

thanks

Code:
   $3 ~ /mx$/ && !s12 {
        printf "sales dept 08                                    %s %s\n",time,date
        print "-----------------"
        print "lead1   07q4    07q3    07q2  07q1  06q4    06q3  jan   nov   dec"
        s12++
        }
          s12 {
                if ( $5 ~ /07q1/ ) {
                   f1++
                   }
                if ( f1 ) {
                        s1[$1"_ld "]=$1 ; s1[$1"_7q4 "]=$2 ; s1[$1"_7q3 "]=$3
                        s1[$1"_7q2 "]=$4; s1[$1"_7q1 "]=$5 ; s1[$1"_6q4 "]=$6
                        s1[$1"_6q3 "]=$7 ; s1[$1"_jan "]=$8
                          for ( i in s1 ) { printf "|%s",i s1[i] }
                   }
                if ( ! NF ) {
                        f1=""
                   }
                if ( $5 ~ /dec$/ ) {
                        f3++
                   }
                if ( f3 ) {
                        s3[$1"_nov "]=$4 ; s3[$1"_dec  "]=$5
                           for ( i in s3 ) { printf "|%s",i s3[i] }
                   }
                if ( ! NF ) {
                        f3=""
                   }
                if ( $3 ~ /my/ ) {
                        print "\n"
                        f3=s12=""
                   }
              }

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing file and extracting the useful data block

Greetings All!! I have a very peculiar problem where I have to parse a big text file and extract useful data out of it with starting and ending block pattern matching. e.g. I have a input file like this: sample data block1 sample data start useful data end sample data block2 sample... (5 Replies)
Discussion started by: arminder
5 Replies

2. Shell Programming and Scripting

Parsing the data in a file

Hi, I have file (FILE.tmp) having contents, FILE.tmp ======== filename=menudata records=0000000000037 ldbname=pinsys timestamp=2005/05/14-18:32:33 I want to parse it bring a new file which will look like, filename records ldbname timestamp... (2 Replies)
Discussion started by: Omkumar
2 Replies

3. Shell Programming and Scripting

urgent<parsing data from a excel file>

Hi all, I wud like to get ur assistance in retrieving lines containing l1.My excel dataset contains around 8000 lines.I converted it into a text tab delimiter file and got the lines containing l1,My output is a list of lines containing l1 saved in a outfile.Some of d lines from my outfile s... (5 Replies)
Discussion started by: sayee
5 Replies

4. Shell Programming and Scripting

parsing data and incorporating it into another file

Hi All I have two files: file 1 >AB_1 MLKKPIIIGVTGGSGGGKTSVSRAILDSFPNARIAMIQHDSYYKDQSHMSFEERVKTNYDHPLAFDTDFM IQQLKELLAGRPVDIPIYDYKKHTRSNTTFRQDPQDVIIVEGILVLEDERLRDLMDIKLFVDTDDDIRII RRIKRDMMERGRSLESIIDQYTSVVKPMYHQFIEPSKRYADIVIPEGVSNVVAIDVINSKIASILGEV >AB_2... (5 Replies)
Discussion started by: Lucky Ali
5 Replies

5. Shell Programming and Scripting

parsing data and incorporating it into another file

Hi, I have a folder that contains many (multiple) files 1.fasta 2.fasta 3.fasta 4.fasta 5.fasta . . 100's of files Each such file have data in the following format for example: vi 1.fasta >AB_1 gi|15835212|ref|NP_296971.1| preprotein translocase subunit SecE... (3 Replies)
Discussion started by: Lucky Ali
3 Replies

6. Shell Programming and Scripting

parsing a portion of Data from a text file

Hi All, I need some help to effectively parse out a subset of results from a big results file. Below is an example of the text file. Each block that I need to parse starts with "Output of GENE for sequence file 100.fasta" (next block starts with another number). I have given the portion of... (8 Replies)
Discussion started by: Lucky Ali
8 Replies

7. Shell Programming and Scripting

parsing data from a big file using keys from another smaller file

Hi, I have 2 files format of file 1 is: a1 b2 a2 c2 d1 f3 format of file 2 is (tab delimited): a1 1.2 0.5 0.06 0.7 0.9 1 0.023 a3 0.91 0.007 0.12 0.34 0.45 1 0.7 a2 1.05 2.3 0.25 1 0.9 0.3 0.091 b1 1 5.4 0.3 9.2 0.3 0.2 0.1 b2 3 5 7 0.9 1 9 0 1 b3 0.001 1 2.3 4.6 8.9 10 0 1 0... (10 Replies)
Discussion started by: Lucky Ali
10 Replies

8. Shell Programming and Scripting

Parsing data using keys from one file

I have 2 text files where I need to parse data from file 2 using the data from file 1. Below are my sample files File 1 (tab delimited) 257 350 670 845 725 1025 767 820 ... .... .... file 2 (tab delimited) 220..450 TA AB650 ABCED 520..850 GA AB720 ABCDE 700..1100 TC AB820 ABCDE... (2 Replies)
Discussion started by: Lucky Ali
2 Replies

9. Shell Programming and Scripting

Parsing C Data Tipes from Input File

Im really beginner in this case, maybe someone can help me find the answer: if my input file like this: void main(int a, int b){ int x; double y; printf("file"); } and i want output like this: int a int b int x double y A awk script that can parse only data tipe, im confused. what... (2 Replies)
Discussion started by: radynaraya
2 Replies

10. Shell Programming and Scripting

Parsing file data

Hey Guys, I'm a novice at shell scripts and i need some help parsing file data. Basically, I want to write a script that retrieves URLs. Here is what I have so far. #!/bin/bash echo "Please enter start date (format: yyyy-mm-dd):\c" read STARTDATE echo "Please enter end date... (7 Replies)
Discussion started by: silverdust
7 Replies
DateTime::Locale::ln(3) 				User Contributed Perl Documentation				   DateTime::Locale::ln(3)

NAME
DateTime::Locale::ln SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'ln' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Lingala. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) mokXlX ya liboso mokXlX ya mibale mokXlX ya misato mokXlX ya minei mokXlX ya mitano mpXXsX eyenga Abbreviated (format) m1 m2 m3 m4 m5 mps eye Narrow (format) 2 3 4 5 6 7 1 Wide (stand-alone) mokXlX ya liboso mokXlX ya mibale mokXlX ya misato mokXlX ya minei mokXlX ya mitano mpXXsX eyenga Abbreviated (stand-alone) m1 m2 m3 m4 m5 mps eye Narrow (stand-alone) 2 3 4 5 6 7 1 Months Wide (format) sanza ya yambo sanza ya mibale sanza ya misato sanza ya minei sanza ya mitano sanza ya motoba sanza ya nsambo sanza ya mwambe sanza ya libwa sanza ya zomi sanza ya zomi na mXXkXX sanza ya zomi na mibale Abbreviated (format) s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 Narrow (format) 1 2 3 4 5 6 7 8 9 10 11 12 Wide (stand-alone) sanza ya yambo sanza ya mibale sanza ya misato sanza ya minei sanza ya mitano sanza ya motoba sanza ya nsambo sanza ya mwambe sanza ya libwa sanza ya zomi sanza ya zomi na mXXkXX sanza ya zomi na mibale Abbreviated (stand-alone) s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Quarters Wide (format) sanza misato ya yambo sanza misato ya mibale sanza misato ya misato sanza misato ya minei Abbreviated (format) SM1 SM2 SM3 SM4 Narrow (format) 1 2 3 4 Wide (stand-alone) sanza misato ya yambo sanza misato ya mibale sanza misato ya misato sanza misato ya minei Abbreviated (stand-alone) SM1 SM2 SM3 SM4 Narrow (stand-alone) 1 2 3 4 Eras Wide liboso ya Y.-K. nsima ya Y.-K. Abbreviated liboso ya Y.-K. nsima ya Y.-K. Narrow liboso ya Y.-K. nsima ya Y.-K. Date Formats Full 2008-02-05T18:30:30 = mokXlX ya mibale, 2008 sanza ya mibale 05 1995-12-22T09:05:02 = mokXlX ya mitano, 1995 sanza ya zomi na mibale 22 -0010-09-15T04:44:23 = mpXXsX, -10 sanza ya libwa 15 Long 2008-02-05T18:30:30 = 2008 sanza ya mibale 5 1995-12-22T09:05:02 = 1995 sanza ya zomi na mibale 22 -0010-09-15T04:44:23 = -10 sanza ya libwa 15 Medium 2008-02-05T18:30:30 = 2008 s2 5 1995-12-22T09:05:02 = 1995 s12 22 -0010-09-15T04:44:23 = -10 s9 15 Short 2008-02-05T18:30:30 = 08/02/05 1995-12-22T09:05:02 = 95/12/22 -0010-09-15T04:44:23 = -10/09/15 Default 2008-02-05T18:30:30 = 2008 s2 5 1995-12-22T09:05:02 = 1995 s12 22 -0010-09-15T04:44:23 = -10 s9 15 Time Formats Full 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Short 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 Default 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Datetime Formats Full 2008-02-05T18:30:30 = mokXlX ya mibale, 2008 sanza ya mibale 05 18:30:30 UTC 1995-12-22T09:05:02 = mokXlX ya mitano, 1995 sanza ya zomi na mibale 22 09:05:02 UTC -0010-09-15T04:44:23 = mpXXsX, -10 sanza ya libwa 15 04:44:23 UTC Long 2008-02-05T18:30:30 = 2008 sanza ya mibale 5 18:30:30 UTC 1995-12-22T09:05:02 = 1995 sanza ya zomi na mibale 22 09:05:02 UTC -0010-09-15T04:44:23 = -10 sanza ya libwa 15 04:44:23 UTC Medium 2008-02-05T18:30:30 = 2008 s2 5 18:30:30 1995-12-22T09:05:02 = 1995 s12 22 09:05:02 -0010-09-15T04:44:23 = -10 s9 15 04:44:23 Short 2008-02-05T18:30:30 = 08/02/05 18:30 1995-12-22T09:05:02 = 95/12/22 09:05 -0010-09-15T04:44:23 = -10/09/15 04:44 Default 2008-02-05T18:30:30 = 2008 s2 5 18:30:30 1995-12-22T09:05:02 = 1995 s12 22 09:05:02 -0010-09-15T04:44:23 = -10 s9 15 04:44:23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 m2 1995-12-22T09:05:02 = 22 m5 -0010-09-15T04:44:23 = 15 mps Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 PM 1995-12-22T09:05:02 = 9:05 AM -0010-09-15T04:44:23 = 4:44 AM Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = m2, 2-5 1995-12-22T09:05:02 = m5, 12-22 -0010-09-15T04:44:23 = mps, 9-15 MMM (LLL) 2008-02-05T18:30:30 = s2 1995-12-22T09:05:02 = s12 -0010-09-15T04:44:23 = s9 MMMd (MMM d) 2008-02-05T18:30:30 = s2 5 1995-12-22T09:05:02 = s12 22 -0010-09-15T04:44:23 = s9 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = m2 s2 5 1995-12-22T09:05:02 = m5 s12 22 -0010-09-15T04:44:23 = mps s9 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = sanza ya mibale 5 1995-12-22T09:05:02 = sanza ya zomi na mibale 22 -0010-09-15T04:44:23 = sanza ya libwa 15 MMMMEd (E MMMM d) 2008-02-05T18:30:30 = m2 sanza ya mibale 5 1995-12-22T09:05:02 = m5 sanza ya zomi na mibale 22 -0010-09-15T04:44:23 = mps sanza ya libwa 15 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = m2, 2008-2-5 1995-12-22T09:05:02 = m5, 1995-12-22 -0010-09-15T04:44:23 = mps, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 s2 1995-12-22T09:05:02 = 1995 s12 -0010-09-15T04:44:23 = -10 s9 yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = m2, 2008 s2 5 1995-12-22T09:05:02 = m5, 1995 s12 22 -0010-09-15T04:44:23 = mps, -10 s9 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 sanza ya mibale 1995-12-22T09:05:02 = 1995 sanza ya zomi na mibale -0010-09-15T04:44:23 = -10 sanza ya libwa yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 SM1 1995-12-22T09:05:02 = 1995 SM4 -0010-09-15T04:44:23 = -10 SM3 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week mokXlX ya liboso SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.18.2 2017-10-06 DateTime::Locale::ln(3)
All times are GMT -4. The time now is 08:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy