Visit Our UNIX and Linux User Community

Top Forums Shell Programming and Scripting Extract data into file with specific field specs Post 302357040 by criddel on Monday 28th of September 2009 01:26:51 PM
Old 09-28-2009
Operating system = AIX, Shell = ksh.

Input data example:

463XXXXXXXXXXXX6<tab>4XXXX9<tab>LIXXX X WXXXXR 4XXX W 4XXX S XXXXXXXXXXXXXXX UT 84XXX USA 0 Y15XXX3


Output Example:

46XXXXX002XXXXX64XXXX9LXXXA X WXLXXR 4XXX W 4XXX S XXXX XXXX XXX XX 84XXX USA 0 Y15XXX3


There's no delimeter just an exact specification of the number of characters per field. Basically they want the name field from position 23 to 57 and the Add1 field to be from 58 to 92 etc..

---------- Post updated at 11:26 AM ---------- Previous update was at 11:25 AM ----------

sry not a very good job with the examples...

Last edited by criddel; 09-28-2009 at 02:36 PM..
 
Test Your Knowledge in Computers #719
Difficulty: Medium
Alan Minsky wrote the book Artificial Neural Networks, attacking the work of Frank Rosenblatt, which became the foundational work in the analysis of artificial intelligence applications in machine learning.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extract specific data from xml format file.

Hi, I need to extract the start time value (bold, red font) under the '<LogEvent ID="Timer Start">' tag (black bold) from a file with the following pattern. There are other LogEventIDs listed in the file as well, making it harder for me to extract out the specific start time that I need. . .... (7 Replies)
Discussion started by: 60doses
7 Replies

2. HP-UX

extract field of characters after a specific pattern - using UNIX shell script

Hello, Below is my input file's content ( in HP-UX platform ): ABCD120672-B21 1 ABCD142257-002 1 ABCD142257-003 1 ABCD142257-006 1 From the above, I just want to get the field of 13 characters that comes after 'ABCD' i.e '120672-B21'... . Could... (2 Replies)
Discussion started by: jansat
2 Replies

3. Shell Programming and Scripting

Extract data from log file from or after the specific date

Hi , I am having a script which will start a process and appends the process related logs to a log file. The log file writes logs with every line starting with date in the format of: date +"%Y %b %d %H:%M:%S". So, in the script, before I start the process, I am storing the date as DATE=`date +"%Y... (5 Replies)
Discussion started by: chiru_h
5 Replies

4. Shell Programming and Scripting

Extract all the content after a specific data

My input: >seq_1 DSASSTRRARRRRTPRTPSLRSRRSDVTCS >seq_3 RMRLRRWRKSCSERS*RRSN >seq_8 RTTGLSERPRLPTTASRSISSRWTR >seq_10 NELPLEKGSLDSISIE >seq_9 PNQGDAREPQAHLPRRQGPRDRPLQAYA+ QVQHRRHDHSRTQH*LCRRRQREDCDRLHR >seq_4 DRGKGQAGCRRPQEGEALVRRCS>seq_6 FA*GLAAQDGEA*SGRG My output: Extract all... (22 Replies)
Discussion started by: patrick87
22 Replies

5. Shell Programming and Scripting

Extract specific data content from a long list of data

My input: Data name: ABC001 Data length: 1000 Detail info Data Direction Start_time End_time Length 1 forward 10 100 90 1 forward 15 200 185 2 reverse 50 500 450 Data name: XFG110 Data length: 100 Detail info Data Direction Start_time End_time Length 1 forward 50 100 50 ... (11 Replies)
Discussion started by: patrick87
11 Replies

6. Shell Programming and Scripting

How to extract specific data and count number containing sets from a file?

Hello everybody! I am quit new here and hope you can help me. Using an awk script I am trying to extract data from several files. The structure of the input files is as follows: TimeStep parameter1 parameter2 parameter3 parameter4 e.g. 1 X Y Z L 1 D H Z I 1 H Y E W 2 D H G F 2 R... (2 Replies)
Discussion started by: Daniel8472
2 Replies

7. Shell Programming and Scripting

extract data in a csv file based on a certain field.

I have a csv file that I need to extract some data from depending on another field after reading info from another text file. The text file would say have 592560 in it. The csv file may have some data like so Field 1 Field2 Field3 Field4 Field5 Field6 20009756 1 ... (9 Replies)
Discussion started by: GroveTuckey
9 Replies

8. Shell Programming and Scripting

How to extract specific data?

Bash scripting beginner here... I have many folders, each folder representing one subject. Not all subjects have all the required files, so I need to somehow cycle through all the data and then extract the data only from subjects who have no files missing. I tried to output the ls command, but... (4 Replies)
Discussion started by: LeftoverStew
4 Replies

9. Shell Programming and Scripting

Extract Specific Information from a particular field

Hi, I am trying to extract a specific information from a file which contains more than 200 million records. Attached the input file for your reference. My file contains information below ... (4 Replies)
Discussion started by: rramkrishnas
4 Replies

10. Shell Programming and Scripting

How-To Extract specific data from a file.

data.txt has several information like the below.. <SERVER>:WEB:MYDOM01:/tmp/cong/MYDOM01,/tmp/app/MYDOM01 <WEBER>:CANES:https-web01,https-web02:/web/apps/https-web01/config <SERVER>:WEB:MYDOM07:/tmp/cong/MYDOM07,/tmp/app/MYDOM07... (7 Replies)
Discussion started by: mohtashims
7 Replies
DateTime::Locale::ta(3) 				User Contributed Perl Documentation				   DateTime::Locale::ta(3)

NAME
DateTime::Locale::ta SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'ta' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Tamil. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) XXXXXXX XXXXXXXX XXXXX XXXXXXX XXXXXX XXX XXXXXX Abbreviated (format) XX XX XX XX XX X XX Narrow (format) XX XX XX XX XX X XX Wide (stand-alone) XXXXXXX XXXXXXXX XXXXX XXXXXXX XXXXXX XXX XXXXXX Abbreviated (stand-alone) XX XX XX XX XX X XX Narrow (stand-alone) XX XX XX XX XX X XX Months Wide (format) XXXXX XXXXXXXX XXXXXX XXXXXX XX XXXX XXXX XXXXXX XXXXXXXXXX XXXXXXXX XXXXXXX XXXXXXXX Abbreviated (format) XX. XXXX. XXXX. XXX. XX XXXX XXXX XX. XXXX. XXX. XX. XXX. Narrow (format) X XX XX X XX XX XX X XX X X XX Wide (stand-alone) XXXXX XXXXXXXX XXXXXX XXXXXX XX XXXX XXXX XXXXXX XXXXXXXXXX XXXXXXXX XXXXXXX XXXXXXXX Abbreviated (stand-alone) XX. XXXX. XXXX. XXX. XX XXXX XXXX XX. XXXX. XXX. XX. XXX. Narrow (stand-alone) X XX XX X XX XX XX X XX X X XX Quarters Wide (format) 1XXX XXXXXXXX 2XXX XXXXXXXX 3XXX XXXXXXXX 4XXX XXXXXXXX Abbreviated (format) Q1 Q2 Q3 Q4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1XXX XXXXXXXX 2XXX XXXXXXXX 3XXX XXXXXXXX 4XXX XXXXXXXX Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide XXXXXXXXXXXXXX XXXX XXX XXXXXX Abbreviated XXXX XXXX Narrow XXXX XXXX Date Formats Full 2008-02-05T18:30:30 = XXXXXXXX, 5 XXXXXXXX, 2008 1995-12-22T09:05:02 = XXXXXX, 22 XXXXXXXX, 1995 -0010-09-15T04:44:23 = XXX, 15 XXXXXXXXXX, -10 Long 2008-02-05T18:30:30 = 5 XXXXXXXX, 2008 1995-12-22T09:05:02 = 22 XXXXXXXX, 1995 -0010-09-15T04:44:23 = 15 XXXXXXXXXX, -10 Medium 2008-02-05T18:30:30 = 5 XXXX., 2008 1995-12-22T09:05:02 = 22 XXX., 1995 -0010-09-15T04:44:23 = 15 XXXX., -10 Short 2008-02-05T18:30:30 = 5-2-08 1995-12-22T09:05:02 = 22-12-95 -0010-09-15T04:44:23 = 15-9--10 Default 2008-02-05T18:30:30 = 5 XXXX., 2008 1995-12-22T09:05:02 = 22 XXX., 1995 -0010-09-15T04:44:23 = 15 XXXX., -10 Time Formats Full 2008-02-05T18:30:30 = 6:30:30 pm UTC 1995-12-22T09:05:02 = 9:05:02 am UTC -0010-09-15T04:44:23 = 4:44:23 am UTC Long 2008-02-05T18:30:30 = 6:30:30 pm UTC 1995-12-22T09:05:02 = 9:05:02 am UTC -0010-09-15T04:44:23 = 4:44:23 am UTC Medium 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 Short 2008-02-05T18:30:30 = 6:30 pm 1995-12-22T09:05:02 = 9:05 am -0010-09-15T04:44:23 = 4:44 am Default 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 Datetime Formats Full 2008-02-05T18:30:30 = XXXXXXXX, 5 XXXXXXXX, 2008 6:30:30 pm UTC 1995-12-22T09:05:02 = XXXXXX, 22 XXXXXXXX, 1995 9:05:02 am UTC -0010-09-15T04:44:23 = XXX, 15 XXXXXXXXXX, -10 4:44:23 am UTC Long 2008-02-05T18:30:30 = 5 XXXXXXXX, 2008 6:30:30 pm UTC 1995-12-22T09:05:02 = 22 XXXXXXXX, 1995 9:05:02 am UTC -0010-09-15T04:44:23 = 15 XXXXXXXXXX, -10 4:44:23 am UTC Medium 2008-02-05T18:30:30 = 5 XXXX., 2008 6:30:30 pm 1995-12-22T09:05:02 = 22 XXX., 1995 9:05:02 am -0010-09-15T04:44:23 = 15 XXXX., -10 4:44:23 am Short 2008-02-05T18:30:30 = 5-2-08 6:30 pm 1995-12-22T09:05:02 = 22-12-95 9:05 am -0010-09-15T04:44:23 = 15-9--10 4:44 am Default 2008-02-05T18:30:30 = 5 XXXX., 2008 6:30:30 pm 1995-12-22T09:05:02 = 22 XXX., 1995 9:05:02 am -0010-09-15T04:44:23 = 15 XXXX., -10 4:44:23 am 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 XX 1995-12-22T09:05:02 = 22 XX -0010-09-15T04:44:23 = 15 X 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 = XX, 2-5 1995-12-22T09:05:02 = XX, 12-22 -0010-09-15T04:44:23 = X, 9-15 MMdd (dd-MM) 2008-02-05T18:30:30 = 05-02 1995-12-22T09:05:02 = 22-12 -0010-09-15T04:44:23 = 15-09 MMM (LLL) 2008-02-05T18:30:30 = XXXX. 1995-12-22T09:05:02 = XXX. -0010-09-15T04:44:23 = XXXX. MMMd (MMM d) 2008-02-05T18:30:30 = XXXX. 5 1995-12-22T09:05:02 = XXX. 22 -0010-09-15T04:44:23 = XXXX. 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = XX XXXX. 5 1995-12-22T09:05:02 = XX XXX. 22 -0010-09-15T04:44:23 = X XXXX. 15 MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 XXXXXXXX 1995-12-22T09:05:02 = 22 XXXXXXXX -0010-09-15T04:44:23 = 15 XXXXXXXXXX MMMMEd (E MMMM d) 2008-02-05T18:30:30 = XX XXXXXXXX 5 1995-12-22T09:05:02 = XX XXXXXXXX 22 -0010-09-15T04:44:23 = X XXXXXXXXXX 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 = XX, 2008-2-5 1995-12-22T09:05:02 = XX, 1995-12-22 -0010-09-15T04:44:23 = X, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 XXXX. 1995-12-22T09:05:02 = 1995 XXX. -0010-09-15T04:44:23 = -10 XXXX. yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = XX, 2008 XXXX. 5 1995-12-22T09:05:02 = XX, 1995 XXX. 22 -0010-09-15T04:44:23 = X, -10 XXXX. 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 XXXXXXXX 1995-12-22T09:05:02 = 1995 XXXXXXXX -0010-09-15T04:44:23 = -10 XXXXXXXXXX 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 Q1 1995-12-22T09:05:02 = 1995 Q4 -0010-09-15T04:44:23 = -10 Q3 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyyyMM (MM-yyyy) 2008-02-05T18:30:30 = 02-2008 1995-12-22T09:05:02 = 12-1995 -0010-09-15T04:44:23 = 09--010 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = XXXXXXXX 2008 1995-12-22T09:05:02 = XXXXXXXX 1995 -0010-09-15T04:44:23 = XXXXXXXXXX -10 Miscellaneous Prefers 24 hour time? No Local first day of the week XXXXXXX 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.16.3 2014-06-10 DateTime::Locale::ta(3)

Featured Tech Videos

All times are GMT -4. The time now is 12:47 PM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy