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)
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT PHP
wordwrap
WORDWRAP(3) 1 WORDWRAP(3)wordwrap - Wraps a string to a given number of charactersSYNOPSIS
string wordwrap (string $str, [int $width = 75], [string $break = "0], [bool $cut = false])
DESCRIPTION
Wraps a string to a given number of characters using a string break character.
PARAMETERS
o $str
- The input string.
o $width
- The number of characters at which the string will be wrapped.
o $break
- The line is broken using the optional $break parameter.
o $cut
- If the $cut is set to TRUE, the string is always wrapped at or before the specified $width. So if you have a word that is larger
than the given width, it is broken apart. (See second example). When FALSE the function does not split the word even if the $width
is smaller than the word width.
RETURN VALUES
Returns the given string wrapped at the specified length.
EXAMPLES
Example #1
wordwrap(3) example
<?php
$text = "The quick brown fox jumped over the lazy dog.";
$newtext = wordwrap($text, 20, "<br />
");
echo $newtext;
?>
The above example will output:
The quick brown fox<br />
jumped over the lazy<br />
dog.
Example #2
wordwrap(3) example
<?php
$text = "A very long woooooooooooord.";
$newtext = wordwrap($text, 8, "
", true);
echo "$newtext
";
?>
The above example will output:
A very
long
wooooooo
ooooord.
Example #3
wordwrap(3) example
<?php
$text = "A very long woooooooooooooooooord. and something";
$newtext = wordwrap($text, 8, "
", false);
echo "$newtext
";
?>
The above example will output:
A very
long
woooooooooooooooooord.
and
something
SEE ALSO nl2br(3), chunk_split(3).
PHP Documentation Group WORDWRAP(3)