Sponsored Content
Top Forums Shell Programming and Scripting awk print string with removing all spaces Post 302945089 by clx on Tuesday 26th of May 2015 06:14:57 AM
Old 05-26-2015
Welcome to the forums.
Your input string seems to be confusing to me. Could you please provide some sample data which is seperated by "|" and provide expected output? ALso how do you reading those input? e.g. from file?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to print arguments along with spaces using awk

Hi All, file_1.txt contains aaa bbbb hhhh vvvvv mmmmm iiiii What i want is to search for the first coloumn of each line using awk.i.e as below: awk '/aaa/ {printf(<>)}' file_1.txt The print part (<>) should contain all the values(or coloumns ) in the particular line(here it... (8 Replies)
Discussion started by: jisha
8 Replies

2. Shell Programming and Scripting

Removing spaces from string

I want a user to be able to paste in a string like "01 3F 20 1F" and have the script reformat it to "013F201F" to pass it on to the next step. I was trying to figure it out with awk but wasnt working well. Never mind, found answer. did not know about tr :) (7 Replies)
Discussion started by: ippy98
7 Replies

3. Shell Programming and Scripting

Removing blank spaces, tab spaces from file

Hello All, I am trying to remove all tabspaces and all blankspaces from my file using sed & awk, but not getting proper code. Please help me out. My file is like this (<b> means one blank space, <t> means one tab space)- $ cat file NARESH<b><b><b>KUMAR<t><t>PRADHAN... (3 Replies)
Discussion started by: NARESH1302
3 Replies

4. Shell Programming and Scripting

Print filenames with spaces using awk

Hello all, I want to list the file contents of the directory and number them. I am using la and awk to do it now, #ls |awk '{print NR "." $1}' 1. alpha 2. beta 3. gamma The problem I have is that some files might also have some spaces in the filenames. #ls alpha beta gamma ... (7 Replies)
Discussion started by: grajp002
7 Replies

5. Shell Programming and Scripting

Print the string between spaces

How to print the strings within a line between two spaces . <ns1:providerErrorCode>141</ns1:providerErrorCode> <ns1:providerErrorText>business_rule_exception-Server.404:Cannot proceed because the subscriber with phone number is either suspended or the account has an unpaid... (8 Replies)
Discussion started by: raghunsi
8 Replies

6. UNIX for Dummies Questions & Answers

Print files with spaces using awk

When I use: find . -ls | awk 'BEGIN { OFS = ";"} {print $1,$2,$11}'I get a nice result, yet the files with spaces in it show only the first word and all other characters after the blank space are not printed. e.g. 'file with a blank space' is printed file 'file_with a blank space' is... (7 Replies)
Discussion started by: dakke
7 Replies

7. Shell Programming and Scripting

Removing columns from awk '{ print $0 }'

I have a one-line command, lsusb | awk '{ $1=""; $2=""; $3=""; $4=""; $5=""; $6=""; print $0 }' It works, and gives the results I expect, I was just wondering if I am missing some easier way to nullify the first 6 column variables? Something like, lsusb | awk '{ $(1-6)=""; print $0 }' But... (10 Replies)
Discussion started by: AlphaLexman
10 Replies

8. Shell Programming and Scripting

awk for removing spaces

HI, I have a file with lot of blank lines, how can I remove those using awk?? Thanks, Shruthi (4 Replies)
Discussion started by: shruthidwh
4 Replies

9. UNIX for Dummies Questions & Answers

AWK print last field including SPACES

I have simple test.sh script, see below: bill_code=`echo $record | awk -F"|" '{print $1}'` Fullname=`echo $record | awk -F"|" '{print $3}'` email=`echo $record | awk -F\ '{print $4}'` The last field contains spaces: see csv below: A0222|Y|DELACRUZ|-cc dell@yahoo.com-cc support@yahoo.com ... (9 Replies)
Discussion started by: quay
9 Replies

10. Shell Programming and Scripting

awk - print columns with text and spaces

Hi, I'm using awk to print columns from a tab delimited text file: awk '{print " "$2" "$3" $6"}' file The problem I have is column 6 contains text with spaces etc which means awk only prints the first word. How can I tell awk to print the whole column content as column 6? Thanks, (10 Replies)
Discussion started by: keenboy100
10 Replies
XSetICFocus(3)							  XLIB FUNCTIONS						    XSetICFocus(3)

NAME
XSetICFocus, XUnsetICFocus - set and unset input context focus SYNTAX
void XSetICFocus(XIC ic); void XUnsetICFocus(XIC ic); ARGUMENTS
ic Specifies the input context. DESCRIPTION
The XSetICFocus function allows a client to notify an input method that the focus window attached to the specified input context has received keyboard focus. The input method should take action to provide appropriate feedback. Complete feedback specification is a matter of user interface policy. Calling XSetICFocus does not affect the focus window value. The XUnsetICFocus function allows a client to notify an input method that the specified input context has lost the keyboard focus and that no more input is expected on the focus window attached to that input context. The input method should take action to provide appropriate feedback. Complete feedback specification is a matter of user interface policy. Calling XUnsetICFocus does not affect the focus window value; the client may still receive events from the input method that are directed to the focus window. SEE ALSO
XCreateIC(3X11), XOpenIM(3X11), XSetICValues(3X11), XmbResetIC(3X11) Xlib - C Language X Interface X Version 11 libX11 1.2.1 XSetICFocus(3)
All times are GMT -4. The time now is 01:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy