Sponsored Content
Top Forums Shell Programming and Scripting Appending the last few columns to the front Post 302212702 by ragavhere on Tuesday 8th of July 2008 06:47:48 AM
Old 07-08-2008
Power Appending the last few columns to the front

Hi

consider this as the first line
00010015 MORGAN STANLEY & CO INCORPORATED N 110 INVESTAR 1 0001OT NJ 201-830-5055 01-Jan-1974 00:00:00 1 01-May-2008 00:00:00 05-Jun-2008 13:34:18 0001 - From SMSRun1_GIDQA02
Consider this as the second line
00010015 MORGAN STANLEY & CO INCORPORATED N 110 INVESTAR 1 0001OT NJ 201-830-5055 01-Jan-1974 00:00:00 1 01-May-2008 00:00:00 05-Jun-2008 13:34:18 0001 egesdegjeog rogjeogje - From SMSRun1_GIDQA02

Here i need to cut "- From SMSRun1_GIDQA02" from the end of each line and need to append it at the front as "From SMSRun1_GIDQA02 - ". So that the output looks like

From SMSRun1_GIDQA02 - 00010015 MORGAN STANLEY & CO INCORPORATED N 110 INVESTAR 1 0001OT NJ 201-830-5055 01-Jan-1974 00:00:00 1 01-May-2008 00:00:00 05-Jun-2008 13:34:18 0001

But the problem here is that the position of "- From SMSRun1_GIDQA02" might vary from line to line since there might be odd number of columns.Can "- From" be taken as a key to cut "- From SMSRun1_GIDQA02" and append it to the front?

Last edited by ragavhere; 07-08-2008 at 07:49 AM.. Reason: Line
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Appending columns on a file

My issue is the following: I have several text files, let's say 10 of them. Each one has three columns separated by a tab: Date, Time and Value. What I want to do next is to have only one text file containing the information: Date, Time, Value1, Value2, Value3, ... , Value10, where Value1... (2 Replies)
Discussion started by: abel
2 Replies

2. Shell Programming and Scripting

appending several columns with awk and paste

Hello, I am trying to solve for a couple of hours now the following problem: I have n files and would like to add the third column of each file to a new file: temp1.txt 1 2 3 1 2 3 1 2 3 temp2.txt 1 2 4 1 2 4 1 2 4 1 2 4 temp3.txt (2 Replies)
Discussion started by: creamcheese
2 Replies

3. UNIX for Dummies Questions & Answers

Sed $ appending to front, not to the end

I keep trying to append some astrix to the end of a line, but it keeps overwriting at the front of the line. These are the originals Fred Fardbarkle:674-843-1385:20 Parak Lane, Duluth, MN 23850:4/12/23:780900 Fred Fardbarkle:674-843-1385:20 Parak Lane, Duluth, MN 23850:4/12/23:780900 ... (5 Replies)
Discussion started by: DrSammyD
5 Replies

4. Shell Programming and Scripting

Appending columns of two files using shell script

Hi, I am using ksh, I want to read one csv file and append the columns of another file with new column. My input file: col1,col2 --------- siri,886 satya,890 priya,850 Another file with the below date:(test.csv) col3 ----- 321 333 442 (1 Reply)
Discussion started by: siri_886
1 Replies

5. UNIX for Dummies Questions & Answers

Appending columns at the end of output using awk/sed

Hi , I have the below ouput, =====gopi===== assasassaa adsadsadsdsada asdsadsadasdsa sadasdsadsd =====kannan=== asdasdasd sadasddsaasd adasdd =====hbk=== asasasssa .... .. I want the output like as below, not able paste here correctly. (2 Replies)
Discussion started by: eeegopikannan
2 Replies

6. Shell Programming and Scripting

Match columns and fetch whatever in front of it

Hi Solved these kind of issues using these codes But these are not wrking for my attached files can anybody check........ awk 'NR==FNR{X++;next}{if(X){print}}' file1 file2 awk 'NR==FNR{X=$0;next}{n=split($1,P," ");sub($1,"",$0);for(i=1;i<=n;i++){if(X]){print P,$0}}}' file1 FS="\t" file2 ... (6 Replies)
Discussion started by: Priyanka Chopra
6 Replies

7. Shell Programming and Scripting

How to format output in columns by appending multi lines one by one?

Hi, I need to display output in below format Customer : Apr 24 16:31 Customer_Name_111121.txt |---Space---|Apr 24 16:32 Customer_Name _111121. txt |---Space---|Apr 24 16:34 Customer_Name_111112. txt |---Space---|Apr 24 16:35 Customer_Name _222223. txt |---Space---|Apr 24 16:37... (8 Replies)
Discussion started by: ketanraut
8 Replies

8. Shell Programming and Scripting

Appending different columns of multiple files in awk

Hello All, I have three input files cat file1 col1|col2|col3 a|1|A b|2|B cat file2 col1|col2|col3 c|3|C cat file3 col1|col2|col3 d|4|D e|5|E i want below output file4 col1|col2 a|1 (6 Replies)
Discussion started by: looney
6 Replies

9. UNIX for Beginners Questions & Answers

Delimiter appending in a data file if we receive a less columns than expected

Required No.of field = 12 Let say you got a “~” delimited input file and this file has 6 input fields and now I want to add 12-5=7 number of “~” into this input file in order to make it 12 fields datafile can have n number of records ex., a~b~c~d~12~r a~b~c~d~12~r a~b~c~d~12~r... (19 Replies)
Discussion started by: LJJ
19 Replies
DateTime::Locale::ms_BN(3)				User Contributed Perl Documentation				DateTime::Locale::ms_BN(3)

NAME
DateTime::Locale::ms_BN SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'ms_BN' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Malay Brunei. DATA
This locale inherits from the DateTime::Locale::ms locale. It contains the following data. Days Wide (format) Isnin Selasa Rabu Khamis Jumaat Sabtu Ahad Abbreviated (format) Isn Sel Rab Kha Jum Sab Ahd Narrow (format) 2 3 4 5 6 7 1 Wide (stand-alone) Isnin Selasa Rabu Khamis Jumaat Sabtu Ahad Abbreviated (stand-alone) Isn Sel Rab Kha Jum Sab Ahd Narrow (stand-alone) 2 3 4 5 6 7 1 Months Wide (format) Januari Februari Mac April Mei Jun Julai Ogos September Oktober November Disember Abbreviated (format) Jan Feb Mac Apr Mei Jun Jul Ogos Sep Okt Nov Dis Narrow (format) 1 2 3 4 5 6 7 8 9 10 11 12 Wide (stand-alone) Januari Februari Mac April Mei Jun Julai Ogos September Oktober November Disember Abbreviated (stand-alone) Jan Feb Mac Apr Mei Jun Jul Ogos Sep Okt Nov Dis Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Quarters Wide (format) suku pertama suku kedua suku ketiga suku keempat Abbreviated (format) S1 S2 S3 S4 Narrow (format) 1 2 3 4 Wide (stand-alone) suku pertama suku kedua suku ketiga suku keempat Abbreviated (stand-alone) S1 S2 S3 S4 Narrow (stand-alone) 1 2 3 4 Eras Wide BCE CE Abbreviated S.M. T.M. Narrow S.M. T.M. Date Formats Full 2008-02-05T18:30:30 = 05 Februari 2008 1995-12-22T09:05:02 = 22 Disember 1995 -0010-09-15T04:44:23 = 15 September -10 Long 2008-02-05T18:30:30 = 05 Februari 2008 1995-12-22T09:05:02 = 22 Disember 1995 -0010-09-15T04:44:23 = 15 September -10 Medium 2008-02-05T18:30:30 = 05/02/2008 1995-12-22T09:05:02 = 22/12/1995 -0010-09-15T04:44:23 = 15/09/-010 Short 2008-02-05T18:30:30 = 05/02/2008 1995-12-22T09:05:02 = 22/12/1995 -0010-09-15T04:44:23 = 15/09/-010 Default 2008-02-05T18:30:30 = 05/02/2008 1995-12-22T09:05:02 = 22/12/1995 -0010-09-15T04:44:23 = 15/09/-010 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 = 18:30:30 UTC 1995-12-22T09:05:02 = 9:05:02 UTC -0010-09-15T04:44:23 = 4:44:23 UTC Medium 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 Short 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 Default 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 Datetime Formats Full 2008-02-05T18:30:30 = 05 Februari 2008 6:30:30 PM UTC 1995-12-22T09:05:02 = 22 Disember 1995 9:05:02 AM UTC -0010-09-15T04:44:23 = 15 September -10 4:44:23 AM UTC Long 2008-02-05T18:30:30 = 05 Februari 2008 18:30:30 UTC 1995-12-22T09:05:02 = 22 Disember 1995 9:05:02 UTC -0010-09-15T04:44:23 = 15 September -10 4:44:23 UTC Medium 2008-02-05T18:30:30 = 05/02/2008 18:30:30 1995-12-22T09:05:02 = 22/12/1995 9:05:02 -0010-09-15T04:44:23 = 15/09/-010 4:44:23 Short 2008-02-05T18:30:30 = 05/02/2008 18:30 1995-12-22T09:05:02 = 22/12/1995 9:05 -0010-09-15T04:44:23 = 15/09/-010 4:44 Default 2008-02-05T18:30:30 = 05/02/2008 18:30:30 1995-12-22T09:05:02 = 22/12/1995 9:05:02 -0010-09-15T04:44:23 = 15/09/-010 4: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 Sel 1995-12-22T09:05:02 = 22 Jum -0010-09-15T04:44:23 = 15 Sab 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 Hmm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 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 = Sel, 2-5 1995-12-22T09:05:02 = Jum, 12-22 -0010-09-15T04:44:23 = Sab, 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 = Feb 1995-12-22T09:05:02 = Dis -0010-09-15T04:44:23 = Sep MMMd (MMM d) 2008-02-05T18:30:30 = Feb 5 1995-12-22T09:05:02 = Dis 22 -0010-09-15T04:44:23 = Sep 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = Sel Feb 5 1995-12-22T09:05:02 = Jum Dis 22 -0010-09-15T04:44:23 = Sab Sep 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = Februari 5 1995-12-22T09:05:02 = Disember 22 -0010-09-15T04:44:23 = September 15 MMMMdd (dd MMMM) 2008-02-05T18:30:30 = 05 Februari 1995-12-22T09:05:02 = 22 Disember -0010-09-15T04:44:23 = 15 September MMMMEd (E MMMM d) 2008-02-05T18:30:30 = Sel Februari 5 1995-12-22T09:05:02 = Jum Disember 22 -0010-09-15T04:44:23 = Sab September 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 = Sel, 2008-2-5 1995-12-22T09:05:02 = Jum, 1995-12-22 -0010-09-15T04:44:23 = Sab, -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 Feb 1995-12-22T09:05:02 = 1995 Dis -0010-09-15T04:44:23 = -10 Sep yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = Sel, 2008 Feb 5 1995-12-22T09:05:02 = Jum, 1995 Dis 22 -0010-09-15T04:44:23 = Sab, -10 Sep 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 Februari 1995-12-22T09:05:02 = 1995 Disember -0010-09-15T04:44:23 = -10 September 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 S1 1995-12-22T09:05:02 = 1995 S4 -0010-09-15T04:44:23 = -10 S3 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 = Februari 2008 1995-12-22T09:05:02 = Disember 1995 -0010-09-15T04:44:23 = September -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week Isnin 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::ms_BN(3)
All times are GMT -4. The time now is 06:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy