Sponsored Content
Top Forums UNIX for Dummies Questions & Answers to remove space in a txt file Post 302276143 by zaxxon on Tuesday 13th of January 2009 06:34:20 AM
Old 01-13-2009
When it does not work, show what did not work.
Also the aspect of writing it to a variable is new.

Try this:
Code:
root@isau02:/data/tmp/testfeld> VAR=`sed -e '/^Started at/!d; q' -e 's/^Started at \(.*\)/\1/' infile`
root@isau02:/data/tmp/testfeld> echo $VAR
MON Jan 11 00:03:24 EST 2009

 

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
PS_HYPHENATE(3) 							 1							   PS_HYPHENATE(3)

ps_hyphenate - Hyphenates a word

SYNOPSIS
array ps_hyphenate (resource $psdoc, string $text) DESCRIPTION
Hyphenates the passed word. ps_hyphenate(3) evaluates the value hyphenminchars (set by ps_set_value(3)) and the parameter hyphendict (set by ps_set_parameter(3)). hyphendict must be set before calling this function. This function requires the locale category LC_CTYPE to be set properly. This is done when the extension is initialized by using the envi- ronment variables. On Unix systems read the man page of locale for more information. PARAMETERS
o $psdoc - Resource identifier of the postscript file as returned by ps_new(3). o $text -$text should not contain any non alpha characters. Possible positions for breaks are returned in an array of interger numbers. Each number is the position of the char in $text after which a hyphenation can take place. RETURN VALUES
An array of integers indicating the position of possible breaks in the text or FALSE on failure. EXAMPLES
Example #1 Hyphennate a text <?php $word = "Koordinatensystem"; $psdoc = ps_new(); ps_set_parameter($psdoc, "hyphendict", "hyph_de.dic"); $hyphens = ps_hyphenate($psdoc, $word); for($i=0; $i<strlen($word); $i++) { echo $word[$i]; if(in_array($i, $hyphens)) echo "-"; } ps_delete($psdoc); ?> The above example will output: Ko-ordi-na-ten-sys-tem SEE ALSO
ps_show_boxed(3), locale(1). PHP Documentation Group PS_HYPHENATE(3)
All times are GMT -4. The time now is 11:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy