Sponsored Content
Top Forums Shell Programming and Scripting replace one or more tabs with commas Post 302272245 by tucs_123 on Tuesday 30th of December 2008 03:41:02 AM
Old 12-30-2008
replace one or more tabs with commas

Hi,

Can any one tell me how to replace one or more tabs from start of the line and in between the words with commas in the file using unix commands?

My actual data in the text file is as below with spaces.The spaces are not being shown in the post..please see them while replying to the post.

Dec 22 2008 8:30PM Dec 22 2008 8:55PM Dec 23 2008 12:00AM Dec 23 2008 1:44AM Dec 23 2008 1:44AM



I want output in a single line as below removing white spaces in the file:

Dec 22 2008 8:30PM,Dec 22 2008 8:55PM,Dec 23 2008 12:00AM,Dec 23 2008 1:44AM,Dec 23 2008 1:44AM

When I use,

cat 2.txt|sed 's/[\t ][\t ][\t ][\t ][\t ]/,/g'
, Dec 22 2008 8:30PM , Dec 22 2008 8:55PM , Dec 23 2008 12:00AM , Dec 23 2008 1:44AM , Dec 23 2008 1:44AM

it works for me,but still I want to remove first comma and blank space between say 8:30PM and comma..how to do that?


Thanks in advance...........
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Cron Tabs

I am on AIX 5.1 If I have a crontab that looks like this 01 1 * * 6 What does the 6 mean ? if the * means that everyday it should run then why would the 6th day be signified ? Shouldn't it be a * also? Thanks (1 Reply)
Discussion started by: rocker40
1 Replies

2. UNIX for Dummies Questions & Answers

Inserting commas and replacing backslashes with commas

Hi, Newbie here. I have a file that consists of data that I want to convert to a csv file. For example: Jul 20 2008 1111 / visit home / BlackBerry8830/4.2.2 Profile/MIDP-2.0 Configuration/CLOC-1.1 VendorID/105 Jul 21 2008 22222 / add friend / BlackBerry8830/4.2.2 Profile/MIDP-2.0... (3 Replies)
Discussion started by: kangaroo
3 Replies

3. Shell Programming and Scripting

parsing log files, removing spaces and replace with commas

Hello all i am working on a database to import log files from my systems, but i cannot seem to find the answer. I searched here for a good bit and couldnt peice together what i was looking for. I know you could do this with awk, i just dont know how. Any help would be greatly appreciated.... (6 Replies)
Discussion started by: caddyjoe77
6 Replies

4. Shell Programming and Scripting

too many tabs

Hi, I have a file that has too many tabs between columns. I cannot get the tabs out. Basically the tab between column 1 and 2 are fine but between 2/3, 3/4 etc are like 5 tabs. How do I get rid of these 5 tabs so its just 1 tab. thanks (3 Replies)
Discussion started by: phil_heath
3 Replies

5. Shell Programming and Scripting

replace spaces/tabs with delimiter |

Hi, I'm looking for a command that replaces spaces/tabs with pipe symbol and store the result to the same file instead of routing it to another file. infile outfile Thanks. (11 Replies)
Discussion started by: dvah
11 Replies

6. Shell Programming and Scripting

replace but skip data between certain commas

OK, I am one needy dude. However, how can I make the program NOT change any of the values BETWEEN the first and second "," ? I dont want any of the numbers changed that are preceded by "AT". I want ALL other numeric values > 300 changed to 300. cat qin.csv |head... (4 Replies)
Discussion started by: herot
4 Replies

7. Shell Programming and Scripting

Replace field with commas with field without commas

Hey guys, I have the following text: 1,2,3,4,5,6,'NULL','when',NULL,1,2,0,'NULL' 1,2,3,4,5,6,'NULL','what','NULL',1,2,0,1 I need the same text with the word NULL without commas u know something like this: 1,2,3,4,5,6,NULL,'when',NULL,1,2,0,NULL 1,2,3,4,5,6,NULL,'what','NULL',1,2,0,1 ... (1 Reply)
Discussion started by: lmyk72
1 Replies

8. Shell Programming and Scripting

Replace commas with newlines

Good afternoon, I am trying to read user input. Here is what I have so far: echo "Type the Container ID for every container that you want subnets exported" echo "for (with comma between each one, for example... 1,45,98)" echo -n "if you want every one listed, then just type ALL in caps... (2 Replies)
Discussion started by: brianjb
2 Replies

9. Shell Programming and Scripting

HELP with AWK or SED. Need to replace the commas between double quotes in CSV file

Hello experts, I need to validate a csv file which contains data like this: Sample.csv "ABCD","I",23,0,9,,"23/12/2012","OK","Street,State, 91135",0 "ABCD","I",23,0,9,,"23/12/2012","OK","Street,State, 91135",0 I just need to check if all the records contain exactly the number of... (5 Replies)
Discussion started by: shell_boy23
5 Replies

10. Shell Programming and Scripting

Inverted commas replace

Hi, My input file is like this chr1 + "NM_1234" chr1 - "NM_1234" If I want my third column to contain both the first and second column values, how do I do it? I know how to do it by including the column numbers, but I want the values before the inverted commas. So, my output would... (5 Replies)
Discussion started by: jacobs.smith
5 Replies
DateTime::Locale::gl(3) 				User Contributed Perl Documentation				   DateTime::Locale::gl(3)

NAME
DateTime::Locale::gl SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'gl' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Galician. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) Luns Martes Mercores Xoves Venres Sabado Domingo Abbreviated (format) Lun Mar Mer Xov Ven Sab Dom Narrow (format) L M M X V S D Wide (stand-alone) Luns Martes Mercores Xoves Venres Sabado Domingo Abbreviated (stand-alone) Lun Mar Mer Xov Ven Sab Dom Narrow (stand-alone) L M M X V S D Months Wide (format) Xaneiro Febreiro Marzo Abril Maio Xun~o Xullo Agosto Setembro Outubro Novembro Decembro Abbreviated (format) Xan Feb Mar Abr Mai Xun~ Xul Ago Set Out Nov Dec Narrow (format) X F M A M X X A S O N D Wide (stand-alone) Xaneiro Febreiro Marzo Abril Maio Xun~o Xullo Agosto Setembro Outubro Novembro Decembro Abbreviated (stand-alone) Xan Feb Mar Abr Mai Xun~ Xul Ago Set Out Nov Dec Narrow (stand-alone) X F M A M X X A S O N D Quarters Wide (format) 1o trimestre 2o trimestre 3o trimestre 4o trimestre Abbreviated (format) T1 T2 T3 T4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1o trimestre 2o trimestre 3o trimestre 4o trimestre Abbreviated (stand-alone) T1 T2 T3 T4 Narrow (stand-alone) 1 2 3 4 Eras Wide antes de Cristo despois de Cristo Abbreviated a.C. d.C. Narrow a.C. d.C. Date Formats Full 2008-02-05T18:30:30 = Martes 05 Febreiro 2008 1995-12-22T09:05:02 = Venres 22 Decembro 1995 -0010-09-15T04:44:23 = Sabado 15 Setembro -10 Long 2008-02-05T18:30:30 = 05 Febreiro 2008 1995-12-22T09:05:02 = 22 Decembro 1995 -0010-09-15T04:44:23 = 15 Setembro -10 Medium 2008-02-05T18:30:30 = 5 Feb, 2008 1995-12-22T09:05:02 = 22 Dec, 1995 -0010-09-15T04:44:23 = 15 Set, -10 Short 2008-02-05T18:30:30 = 05/02/08 1995-12-22T09:05:02 = 22/12/95 -0010-09-15T04:44:23 = 15/09/-10 Default 2008-02-05T18:30:30 = 5 Feb, 2008 1995-12-22T09:05:02 = 22 Dec, 1995 -0010-09-15T04:44:23 = 15 Set, -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 = Martes 05 Febreiro 2008 18:30:30 UTC 1995-12-22T09:05:02 = Venres 22 Decembro 1995 09:05:02 UTC -0010-09-15T04:44:23 = Sabado 15 Setembro -10 04:44:23 UTC Long 2008-02-05T18:30:30 = 05 Febreiro 2008 18:30:30 UTC 1995-12-22T09:05:02 = 22 Decembro 1995 09:05:02 UTC -0010-09-15T04:44:23 = 15 Setembro -10 04:44:23 UTC Medium 2008-02-05T18:30:30 = 5 Feb, 2008 18:30:30 1995-12-22T09:05:02 = 22 Dec, 1995 09:05:02 -0010-09-15T04:44:23 = 15 Set, -10 04:44:23 Short 2008-02-05T18:30:30 = 05/02/08 18:30 1995-12-22T09:05:02 = 22/12/95 09:05 -0010-09-15T04:44:23 = 15/09/-10 04:44 Default 2008-02-05T18:30:30 = 5 Feb, 2008 18:30:30 1995-12-22T09:05:02 = 22 Dec, 1995 09:05:02 -0010-09-15T04:44:23 = 15 Set, -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 Mar 1995-12-22T09:05:02 = 22 Ven -0010-09-15T04:44:23 = 15 Sab Hm (HH:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04: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 (d-M) 2008-02-05T18:30:30 = 5-2 1995-12-22T09:05:02 = 22-12 -0010-09-15T04:44:23 = 15-9 MEd (E, d-M) 2008-02-05T18:30:30 = Mar, 5-2 1995-12-22T09:05:02 = Ven, 22-12 -0010-09-15T04:44:23 = Sab, 15-9 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 = Dec -0010-09-15T04:44:23 = Set MMMd (d MMM) 2008-02-05T18:30:30 = 5 Feb 1995-12-22T09:05:02 = 22 Dec -0010-09-15T04:44:23 = 15 Set MMMEd (E d MMM) 2008-02-05T18:30:30 = Mar 5 Feb 1995-12-22T09:05:02 = Ven 22 Dec -0010-09-15T04:44:23 = Sab 15 Set MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 Febreiro 1995-12-22T09:05:02 = 22 Decembro -0010-09-15T04:44:23 = 15 Setembro MMMMdd (dd MMMM) 2008-02-05T18:30:30 = 05 Febreiro 1995-12-22T09:05:02 = 22 Decembro -0010-09-15T04:44:23 = 15 Setembro MMMMEd (E d MMMM) 2008-02-05T18:30:30 = Mar 5 Febreiro 1995-12-22T09:05:02 = Ven 22 Decembro -0010-09-15T04:44:23 = Sab 15 Setembro 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 (M-yyyy) 2008-02-05T18:30:30 = 2-2008 1995-12-22T09:05:02 = 12-1995 -0010-09-15T04:44:23 = 9--010 yMEd (EEE, d-M-yyyy) 2008-02-05T18:30:30 = Mar, 5-2-2008 1995-12-22T09:05:02 = Ven, 22-12-1995 -0010-09-15T04:44:23 = Sab, 15-9--010 yMMM (MMM y) 2008-02-05T18:30:30 = Feb 2008 1995-12-22T09:05:02 = Dec 1995 -0010-09-15T04:44:23 = Set -10 yMMMEd (EEE, d MMM y) 2008-02-05T18:30:30 = Mar, 5 Feb 2008 1995-12-22T09:05:02 = Ven, 22 Dec 1995 -0010-09-15T04:44:23 = Sab, 15 Set -10 yMMMM (MMMM y) 2008-02-05T18:30:30 = Febreiro 2008 1995-12-22T09:05:02 = Decembro 1995 -0010-09-15T04:44:23 = Setembro -10 yQ (Q yyyy) 2008-02-05T18:30:30 = 1 2008 1995-12-22T09:05:02 = 4 1995 -0010-09-15T04:44:23 = 3 -010 yQQQ (QQQ y) 2008-02-05T18:30:30 = T1 2008 1995-12-22T09:05:02 = T4 1995 -0010-09-15T04:44:23 = T3 -10 yyMM (MM/yy) 2008-02-05T18:30:30 = 02/08 1995-12-22T09:05:02 = 12/95 -0010-09-15T04:44:23 = 09/-10 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = Febreiro 2008 1995-12-22T09:05:02 = Decembro 1995 -0010-09-15T04:44:23 = Setembro -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week Luns 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::gl(3)
All times are GMT -4. The time now is 10:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy