Sponsored Content
Top Forums Shell Programming and Scripting Replace long space to become one space? Post 302374937 by justbow on Thursday 26th of November 2009 02:11:12 AM
Old 11-26-2009
Replace long space to become one space?

Hi,

i have the log attached. Actually i want the long space just become 1 space left
like this :
Quote:
20091116 08:29:18+0800 8540 "pmain" 32.50 8.90 541809 1720080 1472264 4 12.00
20091116 08:29:18+0800 4662 "pmain" 22.10 3.10 1210 613864 511748 3 28.00
20091116 08:29:18+0800 8506 "pmain" 32.90 9.30 548538 1830624 1535508 2 28.00
20091116 08:29:18+0800 8625 "pmain" 29.10 9.90 484269 1955684 1642012 7 36.00
20091116 08:29:18+0800 8609 "pmain" 28.80 10.10 478969 1953236 1665520 6 30.00
20091116 08:29:18+0800 8591 "pmain" 29.50 9.20 491810 1768436 1513796 5 20.00
20091116 08:29:18+0800 8488 "pmain" 32.50 13.30 540725 2879744 2191372 1 26.00
20091116 08:34:46+0800 4714 "pmain" 16.00 3.10 929 615324 513196 8 14.00
20091116 08:34:46+0800 8540 "pmain" 32.50 8.90 541869 1720080 1472960 4 12.00
20091116 08:34:46+0800 4662 "pmain" 22.20 3.10 1290 618612 516496 3 24.00
20091116 08:34:46+0800 8506 "pmain" 32.90 9.30 548614 1830624 1536052 2 22.00
20091116 08:34:46+0800 8625 "pmain" 29.10 9.90 484342 1955684 1643476 7 24.00
20091116 08:34:46+0800 8609 "pmain" 28.70 10.10 479033 1953236 1668500 6 18.00
20091116 08:34:46+0800 8591 "pmain" 29.50 9.20 491893 1768436 1514964 5 22.00
20091116 08:34:46+0800 8488 "pmain" 32.50 13.30 540801 2879744 2192360 1 18.00
20091116 08:40:14+0800 4714 "pmain" 16.30 3.10 998 620476 518356 8 24.00
20091116 08:40:14+0800 8540 "pmain" 32.50 8.90 541937 1720080 1473444 4 16.00
20091116 08:40:14+0800 4662 "pmain" 22.20 3.10 1365 621556 519440 3 20.00

Rgds,
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep : search a long char contain space

Hi, i have to search for a char like that : export var1="i am not happy /not happy" with a command like : grep $var1 file but this not working with me !!! thank you in advance. (2 Replies)
Discussion started by: tizilfin
2 Replies

2. Shell Programming and Scripting

Breaking long lines into (characters, newline, space) groups

Hello, I am currently trying to edit an ldif file. The ldif specification states that a newline followed by a space indicates the subsequent line is a continuation of the line. So, in order to search and replace properly and edit the file, I open the file in textwrangler, search for "\r " and... (14 Replies)
Discussion started by: rowie718
14 Replies

3. UNIX for Advanced & Expert Users

wake up user space thread from kernel space ISR

Hello, I'm searching for a proper way to let the kernel space ISR(implemented in a kernel module) wake up a user space thread on a hardware interrupt. Except for sending a real-time signal, is it possible to use a semaphore? I've searched it on google, but it seems impossible to share a... (0 Replies)
Discussion started by: aaronwong
0 Replies

4. Shell Programming and Scripting

Calculate total space, total used space and total free space in filesystem names matching keyword

Good afternoon! Im new at scripting and Im trying to write a script to calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies

5. Linux

How to reclaim the space which i used to increse the swap space on Xen,

Hi, i have done a blunder here, i increased the swap space on Xen5.6 server machine using below steps :- 1056 dd if=/dev/zero of=/root/myswapfile bs=1M count=1024 1057 ls -l /root/myswapfile 1058 chmod 600 /root/myswapfile 1059 mkswap /root/myswapfile 1060 swapon /root/myswapfile ... (1 Reply)
Discussion started by: apm
1 Replies

6. Solaris

No space left on device but free space and inodes are available...

hi guys, me again ;) i recently opened a thread about physical to zone migration. My zone is mounted over a "bigger" LUN (500GB) and step is now to move the old files, from the physical server, to my zone. We are talking about 22mio of files. i used rsync to do that and every time at... (8 Replies)
Discussion started by: beta17
8 Replies

7. Fedora

Need to incrwase PHYSICAL VOLUME space on hard drive with free space on it

Hi, I run Fedora 17. I created a physical volume of 30GB on a disk with 60GB of space so there is 30GB of free space. On the physical volume, I created my volume group and logical volumes. I assigned all the space in the physical volume to my volume group. I need to add the 30GB of free space... (1 Reply)
Discussion started by: mojoman
1 Replies

8. UNIX for Dummies Questions & Answers

Changing only the first space to a tab in a space delimited text file

Hi, I have a space delimited text file but I only want to change the first space to a tab and keep the rest of the spaces intact. How do I go about doing that? Thanks! (3 Replies)
Discussion started by: evelibertine
3 Replies

9. UNIX for Advanced & Expert Users

Need to remove leading space from awk statement space from calculation

I created a awk state to calculate the number of success however when the query runs it has a leading zero. Any ideas on how to remove the leading zero from the calculation? Here is my query: cat myfile.log | grep | awk '{print $2,$3,$7,$11,$15,$19,$23,$27,$31,$35($19/$15*100)}' 02:00:00... (1 Reply)
Discussion started by: bizomb
1 Replies

10. Shell Programming and Scripting

Gawk --- produce the output in pattern space instead of END space

hi, I'm trying to calculate IP addresses and their respective calls to our apache Server. The standard format of the input is HOST IP DATE/TIME - - "GET/POST reuest" "User Agent" HOST IP DATE/TIME - - "GET/POST reuest" "User Agent" HOST IP DATE/TIME - - "GET/POST reuest" "User Agent" HOST... (2 Replies)
Discussion started by: busyboy
2 Replies
CONVDATE(1)						    InterNetNews Documentation						       CONVDATE(1)

NAME
convdate - Convert to/from RFC 5322 dates and seconds since epoch SYNOPSIS
convdate [-dhl] [-c | -n | -s] [date ...] DESCRIPTION
convdate translates the date/time strings given on the command line, outputting the results one to a line. The input can either be a date in RFC 5322 format (accepting the variations on that format that innd(8) is willing to accept), or the number of seconds since epoch (if -c is given). The output is either ctime(3) results, the number of seconds since epoch, or a Usenet Date: header, depending on the options given. If date is not given, convdate outputs the current date. OPTIONS
-c Each argument is taken to be the number of seconds since epoch (a time_t) rather than a date. -d Output a valid Usenet Date: header instead of the results of ctime(3) for each date given on the command line. This is useful for testing the algorithm used to generate Date: headers for local posts. Normally, the date will be in UTC, but see the -l option. -h Print usage information and exit. -l Only makes sense in combination with -d. If given, Date: headers generated will use the local time zone instead of UTC. -n Rather than outputting the results of ctime(3) or a Date: header, output each date given as the number of seconds since epoch (a time_t). This option doesn't make sense in combination with -d. -s Pass each given date to the RFC 5322 date parser and print the results of ctime(3) (or a Date: header if -d is given). This is the default behavior. EXAMPLES
Most of these examples are taken, with modifications from the original man page dating from 1991 and were run in the EST/EDT time zone. % convdate '10 Feb 1991 10:00:00 -0500' Sun Feb 10 10:00:00 1991 % convdate '13 Dec 91 12:00 EST' '04 May 1990 0:0:0' Fri Dec 13 12:00:00 1991 Fri May 4 00:00:00 1990 % convdate -n '10 feb 1991 10:00' '4 May 90 12:00' 666198000 641880000 % convdate -c 666198000 Sun Feb 10 10:00:00 1991 ctime(3) results are in the local time zone. Compare to: % convdate -dc 666198000 Sun, 10 Feb 1991 15:00:00 +0000 (UTC) % env TZ=PST8PDT convdate -dlc 666198000 Sun, 10 Feb 1991 07:00:00 -0800 (PST) % env TZ=EST5EDT convdate -dlc 666198000 Sun, 10 Feb 1991 10:00:00 -0500 (EST) The system library functions generally use the environment variable TZ to determine (or at least override) the local time zone. HISTORY
Written by Rich $alz <rsalz@uunet.uu.net>, rewritten and updated by Russ Allbery <rra@stanford.edu> for the -d and -l flags. $Id: convdate.pod 8894 2010-01-17 13:04:04Z iulius $ SEE ALSO
active.times(5). INN 2.5.2 2010-02-08 CONVDATE(1)
All times are GMT -4. The time now is 06:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy