Sponsored Content
Full Discussion: Removing spaces in a line
Top Forums Shell Programming and Scripting Removing spaces in a line Post 302354642 by krishna_gnv on Saturday 19th of September 2009 03:03:15 AM
Old 09-19-2009
Removing spaces in a line

Hi All,

I have a line like this
" field1;field2;field3 " (single space after and before double quotes).

Now i have to remove these single space . Kindly help me.

Thanks in advance
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

removing spaces from variables?

I stored results like this VAR=`wc -l < ls.txt` But the value of the wc gave me a padded number. How do I strip the padding from $VAR? Do you think I could use SED? Except instead of a file input, have a variable redirection input? (2 Replies)
Discussion started by: yongho
2 Replies

2. Shell Programming and Scripting

removing spaces

hey.. i had a problem with the unix command when i want to remove the white spaces in a string..i guess i cud do it with a sed command but i get an error when i give space in the square brackets.. string="nh hjh llk" p=`echo $string | sed 's/ //g'` i donno how to give space charater and... (2 Replies)
Discussion started by: sahithi_khushi
2 Replies

3. UNIX for Dummies Questions & Answers

Removing spaces...

Hey, I'm using the command from this thread https://www.unix.com/unix-dummies-questions-answers/590-converting-list-into-line.html to convert vertical lines to horzontal lines. But I need to remove the spaces that is created. Unfortunately I can't figure out where the space is in the code.. I... (2 Replies)
Discussion started by: lost
2 Replies

4. Shell Programming and Scripting

Removing spaces from data

Hi, I want to remove spaces from data. Data is: 1,aa ,21, 22 2,a a ,23 ,24 3, ,25 ,26 output should be: 1,aa,21,22 2,a a,23,24 3, ,25,26 i.e i have to remove leading and trailing spaces.Not the space between data and also i dont want to remove the space if data is... (4 Replies)
Discussion started by: monika
4 Replies

5. UNIX for Dummies Questions & Answers

how to append spaces(say 10 spaces) at the end of each line based on the length of th

Hi, I have a problem where I need to append few spaces(say 10 spaces) for each line in a file whose length is say(100 chars) and others leave as it is. I tried to find the length of each line and then if the length is say 100 chars then tried to write those lines into another file and use a sed... (17 Replies)
Discussion started by: prathima
17 Replies

6. 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

7. 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

8. Shell Programming and Scripting

Removing blanks, spaces

I have pipe separated file with lots of blank spaces. After using sed -e 's/ *| */|/g' this command ,its giving me output as TT0000013101640| HCAMBLAMCNB010|Jul 3 2012 11:14AM| HARYANA| Bangali Mohalla | TCL-UBR|9368040005|9355264655|9218509220|NULL ... (5 Replies)
Discussion started by: sususa
5 Replies

9. Shell Programming and Scripting

Removing spaces from line matching a pattern

Hi, I want to remove the spaces from all the lines matching a particular pattern from my file. For instance in file abc.txt I have following data. Header,This is the header 111,this is 1st record 222, this is 2nd record 333, this is 3rd record Footer,3 records found Footer,111222333 ... (5 Replies)
Discussion started by: decci_7
5 Replies

10. Shell Programming and Scripting

Removing tab spaces at the end of each line

I have a file which contains the data lines like below.I want to remove the tab spaces at the end of each line.I have tried with the command sed 's/\+$//' file.but it does not work.Can anyone help me on this? 15022 15022 15022 15022 15022 15022 15023 15023 15023 15023 15023 ... (16 Replies)
Discussion started by: am24
16 Replies
YAZ_SORT(3)								 1							       YAZ_SORT(3)

yaz_sort - Sets sorting criteria

SYNOPSIS
void yaz_sort (resource $id, string $criteria) DESCRIPTION
This function sets sorting criteria and enables Z39.50 Sort. Call this function beforeyaz_search(3). Using this function alone does not have any effect. When used in conjunction with yaz_search(3), a Z39.50 Sort will be sent after a search response has been received and before any records are retrieved with Z39.50 Present (yaz_present(3). PARAMETERS
o $id - The connection resource returned by yaz_connect(3). o $criteria - A string that takes the form field1 flags1 field2 flags2 where field1 specifies the primary attributes for sort, field2 seconds, etc.. The field specifies either a numerical attribute combinations consisting of type=value pairs separated by comma (e.g. 1=4,2=1) ; or the field may specify a plain string criteria (e.g. title. The flags is a sequence of the following characters which may not be separated by any white space. Sort Flags o a - Sort ascending o d - Sort descending o i - Case insensitive sorting o s - Case sensitive sorting RETURN VALUES
No value is returned. EXAMPLES
Example #1 Sort Criterias To sort on Bib1 attribute title, case insensitive, and ascending you would use the following sort criteria: 1=4 ia If the secondary sorting criteria should be author, case sensitive and ascending you would use: 1=4 ia 1=1003 sa PHP Documentation Group YAZ_SORT(3)
All times are GMT -4. The time now is 06:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy