Sponsored Content
Full Discussion: merging similar lines
Top Forums Shell Programming and Scripting merging similar lines Post 302313110 by adambot on Monday 4th of May 2009 08:56:41 PM
Old 05-04-2009
merging similar lines

Greetings, I have been trying to merge the following lines:
Code:
Sat. May 9 8:00 PM
Sat. May 9 8:00 PM CW
Sat. May 9 8:00 PM CW Cursed
Sat. May 9 9:00 PM
Sat. May 9 9:00 PM CW
Sat. May 9 9:00 PM CW Sanctuary
Sat. May 16 8:00 PM
Sat. May 16 8:00 PM CW
Sat. May 16 8:00 PM CW Sanctuary
Sat. May 16 9:00 PM
Sat. May 16 9:00 PM CW
Sat. May 16 9:00 PM CW Fever
Sat. May 16 9:00 PM CW Fever #1.21

however when i run the following:
Code:
uniq -u -i -f6

I still get this:
Code:
Sat. May 9 8:00 PM CW Cursed
Sat. May 9 9:00 PM CW Sanctuary
Sat. May 16 8:00 PM CW Sanctuary
Sat. May 16 9:00 PM CW Fever
Sat. May 16 9:00 PM CW Fever #1.21

why doesn't the second and third (the sanctuary lines) merge?

Also -- is there a way to do this with a perl script with the added requirement that if there is something like #1.21 then it keeps that line over the one that does not have it?

thanks!!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting the similar lines

Dear Friends myself Avinash working in bash shell The problem goes like this I have a file called work.txt assume that first colum=mac address second colum= IP third colum = port number ---------------------------------------- 00:12:23:34 192.168.50.1 2 00:12:23:35 192.168.50.1 5... (2 Replies)
Discussion started by: avi.skynet
2 Replies

2. Shell Programming and Scripting

Urgent help needed on merging lines with similar words

Hi everyone, I need help with a merging problem. Basically, I have a file with several lines (in this example 9 lines) such as: Amie, Jay, Sasha, Rob, Kay Mia, Frank Jay, Nancy, Cecil Paul, Ked, Nancy, 17, Fred 14, 16, 18, 20 9, 11 12, Frank 18, Peter, 62 Nancy, 27 A delimiter is... (3 Replies)
Discussion started by: awb221
3 Replies

3. Shell Programming and Scripting

merging similar columns in a single line file

Hi Guys. I have tried the commands sort and join. But I couldn't able to to find the command for joining in a single line based on keys.My example inputs and outputs are like the following. Help would be appreciated.:D Input file a1tabXXXXXXX a2tabXXXXXXX a6tabYYYYYYYYY a71tabXXXXXXX... (7 Replies)
Discussion started by: repinementer
7 Replies

4. Shell Programming and Scripting

Counting similar lines

Hi, I have a little problem with counting lines. I know similar topics from this forum, but they don't resolve my problem. I have file with lines like this: 2009-05-25 16:55:32,143 some text some regular expressions ect. 2009-05-25 16:55:32,144 some text. 2009-05-28 18:15:12,148 some... (4 Replies)
Discussion started by: marcinnnn
4 Replies

5. Shell Programming and Scripting

Maximum Value of similar lines

Hi, Pretty new to scripting sed awk etc. I'm trying to speed up calculations of disk space allocation. I've extracted the data i want and cleaned it up but i cant figure out the final step. I need to discover a Maximum value of 1 field where the value of another field is the same using awk so... (4 Replies)
Discussion started by: imarcs
4 Replies

6. Shell Programming and Scripting

merging two .txt files by alternating x lines from file 1 and y lines from file2

Hi everyone, I have two files (A and B) and want to combine them to one by always taking 10 rows from file A and subsequently 6 lines from file B. This process shall be repeated 40 times (file A = 400 lines; file B = 240 lines). Does anybody have an idea how to do that using perl, awk or sed?... (6 Replies)
Discussion started by: ink_LE
6 Replies

7. Shell Programming and Scripting

Merging two columns from two files with similar names into a loop

I have two files like this: fileA.net A B C fileA.dat 1 2 3 and I want the output output_expected A 1 B 2 C 3 I know that the easier way is to do a paste fileA.net fileA.dat, but the problem is that I have 10,000 couple of files (fileB.net with fileB.dat; fileC.net with... (3 Replies)
Discussion started by: valente
3 Replies

8. Shell Programming and Scripting

Count lines with similar tokens

I have 2 files, and I wish to count number of lines with this characteristic: if any token at line x in file1, is similar to a token at line x in file2. Here's an example: file1: ab, abc ef fg file2: ab cd ef gh In this case I wish to get 3. Note that token of file1 are... (3 Replies)
Discussion started by: Viernes
3 Replies

9. Shell Programming and Scripting

Merging multiple lines to columns with awk, while inserting commas for missing lines

Hello all, I have a large csv file where there are four types of rows I need to merge into one row per person, where there is a column for each possible code / type of row, even if that code/row isn't there for that person. In the csv, a person may be listed from one to four times... (9 Replies)
Discussion started by: RalphNY
9 Replies

10. Solaris

Getting similar lines in two files

Hi, I need to compare the /etc/passwd files from 2 servers, and extract the users that are similar in these two files. I sorted the 2 files based on the user IDs (UID) (3rd column). I first sorted the files using the username (1st column), however when I use comm to compare the files there is no... (1 Reply)
Discussion started by: anaigini45
1 Replies
DateTime::Locale::ha(3) 				User Contributed Perl Documentation				   DateTime::Locale::ha(3)

NAME
DateTime::Locale::ha SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'ha' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Hausa. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) Litini Talata Laraba Alhamis Jumma'a Asabar Lahadi Abbreviated (format) Lit Tal Lar Alh Jum Asa Lah Narrow (format) L T L A J A L Wide (stand-alone) Litini Talata Laraba Alhamis Jumma'a Asabar Lahadi Abbreviated (stand-alone) Lit Tal Lar Alh Jum Asa Lah Narrow (stand-alone) L T L A J A L Months Wide (format) Janairu Fabrairu Maris Afrilu Mayu Yuni Yuli Augusta Satumba Oktoba Nuwamba Disamba Abbreviated (format) Jan Fab Mar Afr May Yun Yul Aug Sat Okt Nuw Dis Narrow (format) J F M A M Y Y A S O N D Wide (stand-alone) Janairu Fabrairu Maris Afrilu Mayu Yuni Yuli Augusta Satumba Oktoba Nuwamba Disamba Abbreviated (stand-alone) Jan Fab Mar Afr May Yun Yul Aug Sat Okt Nuw Dis Narrow (stand-alone) J F M A M Y Y A S O N D Quarters Wide (format) Q1 Q2 Q3 Q4 Abbreviated (format) Q1 Q2 Q3 Q4 Narrow (format) 1 2 3 4 Wide (stand-alone) Q1 Q2 Q3 Q4 Abbreviated (stand-alone) Q1 Q2 Q3 Q4 Narrow (stand-alone) 1 2 3 4 Eras Wide Gabanin Miladi Miladi Abbreviated GM M Narrow GM M Date Formats Full 2008-02-05T18:30:30 = Talata, 5 Fabrairu, 2008 1995-12-22T09:05:02 = Jumma'a, 22 Disamba, 1995 -0010-09-15T04:44:23 = Asabar, 15 Satumba, -10 Long 2008-02-05T18:30:30 = 5 Fabrairu, 2008 1995-12-22T09:05:02 = 22 Disamba, 1995 -0010-09-15T04:44:23 = 15 Satumba, -10 Medium 2008-02-05T18:30:30 = 5 Fab, 2008 1995-12-22T09:05:02 = 22 Dis, 1995 -0010-09-15T04:44:23 = 15 Sat, -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 Fab, 2008 1995-12-22T09:05:02 = 22 Dis, 1995 -0010-09-15T04:44:23 = 15 Sat, -10 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 = Talata, 5 Fabrairu, 2008 18:30:30 UTC 1995-12-22T09:05:02 = Jumma'a, 22 Disamba, 1995 09:05:02 UTC -0010-09-15T04:44:23 = Asabar, 15 Satumba, -10 04:44:23 UTC Long 2008-02-05T18:30:30 = 5 Fabrairu, 2008 18:30:30 UTC 1995-12-22T09:05:02 = 22 Disamba, 1995 09:05:02 UTC -0010-09-15T04:44:23 = 15 Satumba, -10 04:44:23 UTC Medium 2008-02-05T18:30:30 = 5 Fab, 2008 18:30:30 1995-12-22T09:05:02 = 22 Dis, 1995 09:05:02 -0010-09-15T04:44:23 = 15 Sat, -10 04:44:23 Short 2008-02-05T18:30:30 = 5/2/08 18:30 1995-12-22T09:05:02 = 22/12/95 09:05 -0010-09-15T04:44:23 = 15/9/-10 04:44 Default 2008-02-05T18:30:30 = 5 Fab, 2008 18:30:30 1995-12-22T09:05:02 = 22 Dis, 1995 09:05:02 -0010-09-15T04:44:23 = 15 Sat, -10 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 Tal 1995-12-22T09:05:02 = 22 Jum -0010-09-15T04:44:23 = 15 Asa 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, d-M) 2008-02-05T18:30:30 = Tal, 5-2 1995-12-22T09:05:02 = Jum, 22-12 -0010-09-15T04:44:23 = Asa, 15-9 MMM (LLL) 2008-02-05T18:30:30 = Fab 1995-12-22T09:05:02 = Dis -0010-09-15T04:44:23 = Sat MMMd (d MMM) 2008-02-05T18:30:30 = 5 Fab 1995-12-22T09:05:02 = 22 Dis -0010-09-15T04:44:23 = 15 Sat MMMEd (E d MMM) 2008-02-05T18:30:30 = Tal 5 Fab 1995-12-22T09:05:02 = Jum 22 Dis -0010-09-15T04:44:23 = Asa 15 Sat MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 Fabrairu 1995-12-22T09:05:02 = 22 Disamba -0010-09-15T04:44:23 = 15 Satumba MMMMEd (E d MMMM) 2008-02-05T18:30:30 = Tal 5 Fabrairu 1995-12-22T09:05:02 = Jum 22 Disamba -0010-09-15T04:44:23 = Asa 15 Satumba 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, d/M/yyyy) 2008-02-05T18:30:30 = Tal, 5/2/2008 1995-12-22T09:05:02 = Jum, 22/12/1995 -0010-09-15T04:44:23 = Asa, 15/9/-010 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 Fab 1995-12-22T09:05:02 = 1995 Dis -0010-09-15T04:44:23 = -10 Sat yMMMEd (EEE, d MMM y) 2008-02-05T18:30:30 = Tal, 5 Fab 2008 1995-12-22T09:05:02 = Jum, 22 Dis 1995 -0010-09-15T04:44:23 = Asa, 15 Sat -10 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 Fabrairu 1995-12-22T09:05:02 = 1995 Disamba -0010-09-15T04:44:23 = -10 Satumba 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 Miscellaneous Prefers 24 hour time? Yes Local first day of the week Litini 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.2 2013-08-25 DateTime::Locale::ha(3)
All times are GMT -4. The time now is 05:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy