Sponsored Content
Top Forums Shell Programming and Scripting (g)awk how to preseve white spaces (FS characters) or read a right subpart of $0? Post 302338433 by ryandegreat25 on Tuesday 28th of July 2009 01:55:20 AM
Old 07-28-2009
you can try to use cut
Code:
echo $line | cut -d' ' -f8-

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

deleting white spaces

How would I delete white spaces in a specified file? Also, I'd like to know what command I would use to take something off a regular expression, and put it onto another. ie. . . . expression1 <take_off> . . . expression2 (put here) . . . Any help would be great, thanks! (10 Replies)
Discussion started by: cary530
10 Replies

2. Shell Programming and Scripting

delete white spaces

hi all... i have the next question: i have a flat file with a lot of records (lines). Each record has 10 fields, which are separated by pipe (|). My problem is what sometimes, in the first record, there are white spaces (no values, nothing) in the beginning of the record, like this: ws ws... (2 Replies)
Discussion started by: DebianJ
2 Replies

3. Shell Programming and Scripting

Trim white spaces using awk

Hi, I have a CSV file with footer information as below. The third value is the number of records in the file. Sometimes it contains both leading and trailing white spaces which i want to trim using awk. C,FOOTER , 00000642 C,FOOTER , 00000707 C, FOOTER,... (2 Replies)
Discussion started by: mona
2 Replies

4. Shell Programming and Scripting

trimming white spaces

I have a variable that calls in a string from txt file. Problem is the string comes with an abundance of white spaces trailing it. Is there any easy way to trim the tailing white spaces off at the end? Thanks in advance. (9 Replies)
Discussion started by: briskbaby
9 Replies

5. UNIX for Dummies Questions & Answers

Replace only first found white spaces with some other characters

Anybody can help me How can I replace only four first white spaces with , or any other characters aaaa 08/31/2004 08/31/2009 permanent Logical Processors in System: 64 bedad 08/16/2001 08/15/2011 permanent Logical Processors in System: 64 badnv14 05/31/2008 05/30/2013 permanent Logical... (5 Replies)
Discussion started by: pareshan
5 Replies

6. Solaris

removing special characters, white spaces from a field in a file

what my code is doing, it is executing a sql file and the resullset of the query is getting stored in the text file in a fixed format. for that fixed format i have used the following code:: Code: awk -F":"... (2 Replies)
Discussion started by: priyanka3006
2 Replies

7. Shell Programming and Scripting

Leading white spaces

Hi, I am having problem in deleting the leading spaces:- cat x.csv baseball,NULL,8798765,Most played baseball,NULL,8928192,Most played baseball,NULL,5678945,Most played cricket,NOTNULL,125782,Usually played cricket,NOTNULL,678921,Usually played $ nawk 'BEGIN{FS=","}!a... (2 Replies)
Discussion started by: scripter12
2 Replies

8. AIX

Replace all TAB characters with white spaces

Dear Gurus Can you please advise me on how to Replace all TAB characters with white spaces in a text file in AIX? Either using vi or any utilities (2 Replies)
Discussion started by: tenderfoot
2 Replies

9. Shell Programming and Scripting

Bash - read white spaces

Hello! I have one problem with my bash script - I would like to be able to read white space characters from stdin (for example single " ") - can I acomplish that somehow? I need to read only one character at the time, so I use read -s -n 1 var but it doesn't work for whitespaces apparently. ... (3 Replies)
Discussion started by: xqwzts
3 Replies

10. Shell Programming and Scripting

Removing blank/white spaces and special characters

Hello All , 1. I am trying to do a task where I need to remove Blank spaces from my file , I am usingawk '{$1=$1}{print}' file>file1Input :- ;05/12/1990 ;31/03/2014 ; Output:- ;05/12/1990 ;31/03/2014 ;This command is not removing all spaces from... (6 Replies)
Discussion started by: himanshu sood
6 Replies
WORDWRAP(3)								 1							       WORDWRAP(3)

wordwrap - Wraps a string to a given number of characters

SYNOPSIS
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)
All times are GMT -4. The time now is 09:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy