Sponsored Content
Top Forums UNIX for Dummies Questions & Answers to remove space in a txt file Post 302276148 by manit on Tuesday 13th of January 2009 06:41:15 AM
Old 01-13-2009
bash-2.05$ VAR=`sed '/^Started at/!d; q' DPRPT504.log| sed 's/^Started at \(.*\)/\1/'`
++ sed '/^Started at/!d; q' DPRPT504.log
++ sed 's/^Started at \(.*\)/\1/'
+ VAR=
bash-2.05$ echo $VAR
+ echo
bash-2.05$ pwd

here DPRPT504.log is a file from where i want to capture the start date
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove first column of a space delimited txt

how to remove the first column of a space delimited txt file? there are 12+ columns... what is the cleanest way? could use awk and print all but the first, but it looks kinda ugly awk '{print $2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" "$10" "$11" "$12"}' file.txt whats a better way? (1 Reply)
Discussion started by: ajp7701
1 Replies

2. Shell Programming and Scripting

sed to remove last 2 characters of txt file

sed 's/^..//' file1.txt > file2.txt this will remove the first two characters of each line of a text file, what sed command will remove the last two characters? This is a similar post to my other....sry if I'm being lazy.... I need a file like this (same as last post) >cat file1.txt 10081551... (1 Reply)
Discussion started by: ajp7701
1 Replies

3. Shell Programming and Scripting

remove space from file content

i am a bit new to shell scripting i have a file containing xxxx xx xx but i want to output the content as xxxxxxxx. thus removing the space. any idea how i can do this (4 Replies)
Discussion started by: blackzinga
4 Replies

4. UNIX for Dummies Questions & Answers

Space in file how to remove

Hello I have a file with data something like this in it : texttexttext "text .lst" TEXT=" text " texttexttext "moretext .lst" TEXT=" text " Question is how do I get rid of space so that the files looks like this : texttexttext "text.lst" TEXT="text" texttexttext... (8 Replies)
Discussion started by: davebw
8 Replies

5. Shell Programming and Scripting

Export data from DB2 table to .txt file(space delimited)

Hi I need help on this. Its very urgent for me.. please try to help me out.. I have data in tables in DB2 database. I would like to export the data from DB2 tables into a text file, which has to be space delimited. so that I can carry out awk, grep operations on that file. I tried to export... (2 Replies)
Discussion started by: ss3944
2 Replies

6. Shell Programming and Scripting

Command to remove numbers from beginning of txt file

Hello. I have the following issue: my txt file has the following format: train/dr4/fklc0/sx175.txt 0 80282 Severe myopia contributed to Ron's inferiority complex. train/dr4/fklc0/sx355.txt 0 42906 Dolphins are intelligent marine mammals. train/dr4/fklc0/sa2.txt With the... (1 Reply)
Discussion started by: li_bi
1 Replies

7. Shell Programming and Scripting

Remove space in whole file -perl

Hi all, I have a file which have say about 123,000 records, the records in it look like: 1294160401681,05-01-2011 00:00:01,68,Cjw,2,3333,7,1100,900,SUCCESS,200,68,localhost, 1294160406515,05-01-2011 00:00:06,68,Cjw,2,0207,7,1100,900,SUCCESS,200,68,localhost, 1294160410097,05-01-2011... (3 Replies)
Discussion started by: danihamdani
3 Replies

8. Shell Programming and Scripting

How to remove space from each record in file?

Hi , I want to remove space from each record in one file My file is like BUD, BDL ABC, DDD, ABC ABC, DDD, DDD, KKK The o/p should be BUD,BDL ABC,DDD,ABC ABC,DDD,DDD,KKK Can any one help me regarding this? (9 Replies)
Discussion started by: jagdishrout
9 Replies

9. Shell Programming and Scripting

How to remove space and delimit a csv file?

Hi All , I am facing a small challenge i need unix command to remove space as well as replace "|" to "," in a csv file . original file : A | B | c | D E | F | G | H I | J | K | L P | M | N | O Expected o/p: A,B,c,D E,F,G,H I,J,K,L P,M,N,O (4 Replies)
Discussion started by: Sweety532
4 Replies

10. Shell Programming and Scripting

Remove space before numbers in delimited file

Hi, I have a file which looks like this FORD|1333-1| 10000100010203| 100040507697|0002|356.45|5555| SSSSY|KKKKM|1000005|10| N096|10043| C987 I need the output to look like this FORD|1333-1|10000100010203|100040507697|0002|356.45|5555| SSSSY|KKKKM|1000005|10| N096|10043| C987 The leading... (8 Replies)
Discussion started by: wahi80
8 Replies
PHP_UNAME(3)								 1							      PHP_UNAME(3)

php_uname - Returns information about the operating system PHP is running on

SYNOPSIS
string php_uname ([string $mode = "a"]) DESCRIPTION
php_uname(3) returns a description of the operating system PHP is running on. This is the same string you see at the very top of the phpinfo(3) output. For the name of just the operating system, consider using the PHP_OS constant, but keep in mind this constant will con- tain the operating system PHP was built on. On some older UNIX platforms, it may not be able to determine the current OS information in which case it will revert to displaying the OS PHP was built on. This will only happen if your uname() library call either doesn't exist or doesn't work. PARAMETERS
o $mode -$mode is a single character that defines what information is returned: o 'a': This is the default. Contains all modes in the sequence "s n r v m". o 's': Operating system name. eg. FreeBSD. o 'n': Host name. eg. localhost.example.com. o 'r': Release name. eg. 5.1.2-RELEASE. o 'v': Version information. Varies a lot between operating systems. o 'm': Machine type. eg. i386. RETURN VALUES
Returns the description, as a string. EXAMPLES
Example #1 Some php_uname(3) examples <?php echo php_uname(); echo PHP_OS; /* Some possible outputs: Linux localhost 2.4.21-0.13mdk #1 Fri Mar 14 15:08:06 EST 2003 i686 Linux FreeBSD localhost 3.2-RELEASE #15: Mon Dec 17 08:46:02 GMT 2001 FreeBSD Windows NT XN1 5.1 build 2600 WINNT */ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { echo 'This is a server using Windows!'; } else { echo 'This is a server not using Windows!'; } ?> There are also some related Predefined PHP constants that may come in handy, for example: Example #2 A few OS related constant examples <?php // *nix echo DIRECTORY_SEPARATOR; // / echo PHP_SHLIB_SUFFIX; // so echo PATH_SEPARATOR; // : // Win* echo DIRECTORY_SEPARATOR; // echo PHP_SHLIB_SUFFIX; // dll echo PATH_SEPARATOR; // ; ?> SEE ALSO
phpversion(3), php_sapi_name(3), phpinfo(3). PHP Documentation Group PHP_UNAME(3)
All times are GMT -4. The time now is 07:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy