Sponsored Content
Top Forums UNIX for Advanced & Expert Users how to search delimiter tab in a line and replace it Post 302224429 by kkraja on Wednesday 13th of August 2008 06:26:10 AM
Old 08-13-2008
thanks for reply me,

i tried with both but it shows like this


This#is#a#line The#should#be#changed

plz help me....




Quote:
Originally Posted by era
By "tab space" do you mean two characters, ASCII

9 and ASCII 32, or one character, just ASCII 9?

If the former, 's/ \t/#/' without the [ ]

If the latter, just 's/\t/#/' should work, although the command line you posted should also (accidentally) work.

If your sed doesn't understand \t then try entering a literal tab. In many shells, you type ctrl-v tab to get an actual tab into your command line.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cutting a tab delimiter file

I have a 30 column tab delimited record file. I need to extract the first 10column. The following command to cut was not working cut -f 1-10 -d "\t" filename. Could any one keep on this . Thanks in Advance (4 Replies)
Discussion started by: vinod.thayil
4 Replies

2. Shell Programming and Scripting

Perl: Search for string on line then search and replace text

Hi All, I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text. An example of 4 lines in my file is: 1. MatchText_randomNumberOfText moreData ReplaceMe moreData 2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Discussion started by: Crypto
4 Replies

3. Shell Programming and Scripting

how to replace new line ( \n ) with space or Tab in Sed

Hi, how to replace new line with tab in sed ... i used sed -e 's/\n/\t/g' <filename > but its not working (1 Reply)
Discussion started by: mail2sant
1 Replies

4. Shell Programming and Scripting

Replace spaces between strings in a line with tab

Hi All I am having problem in substitution of any number of spaces, or a combination of space and tab in between strings in the lines of text file. Is there any way out in Perl? Please help me. e.g., Say the input is in the following format:- XX yyy zzz... (1 Reply)
Discussion started by: my_Perl
1 Replies

5. UNIX for Dummies Questions & Answers

Delimiter: Tab or Space?

Hello, Is there a direct command to check if the delimiter in your file is a tab or a space? And how can they be converted from one to another. Thanks, G (4 Replies)
Discussion started by: Gussifinknottle
4 Replies

6. UNIX for Advanced & Expert Users

Search Parameter in first line and replace next line content

Hi, I need help. I have XML file as below &lt;a n=&quot;infoLevel&quot;&gt; &lt;v s=&quot;true&quot;/&gt; &lt;/a&gt; &lt;a n=&quot;localAddr&quot;&gt; &lt;v s=&quot;server.host.com&quot;/&gt; &lt;/a&gt; &lt;a n=&quot;ListenPort&quot;&gt; &lt;v s=&quot;21111&quot;/&gt; &lt;/a&gt; I need to find variable "ListenPort" in line and then replace... (4 Replies)
Discussion started by: rdtrivedi
4 Replies

7. Shell Programming and Scripting

search for a string without fixed delimiter in the line

Hi Need your help to assign the string to a variable from a line which has no fixed delimter in unix. for example , my file contains Name="report"" File Name one="test1" File Name two="test2" now how do I read report , test1 and test2 ? var1=report var2=test1 var3=test2 ... (1 Reply)
Discussion started by: rashmisb
1 Replies

8. Shell Programming and Scripting

perl search and replace - search in first line and replance in 2nd line

Dear All, i want to search particular string and want to replance next line value. following is the test file. search string is tmp,??? ,10:1 "???" may contain any 3 character it should remain the same and next line replace with ,10:50 tmp,123 --- if match tmp,??? then... (3 Replies)
Discussion started by: arvindng
3 Replies

9. Shell Programming and Scripting

Compare two tab-delimiter files

Hi, I have two files like: file1 chr1 40 chr1 50 chr2 10 chr2 60 file2 chr1 30 chr1 50 chr2 15 chr2 20 and want to get the difference of column 2 when column 1 is the same in both files. (4 Replies)
Discussion started by: linseyr
4 Replies

10. Shell Programming and Scripting

Multiple line search, replace second line, using awk or sed

All, I appreciate any help you can offer here as this is well beyond my grasp of awk/sed... I have an input file similar to: &LOG &LOG Part: "@DB/TC10000021855/--F" &LOG &LOG &LOG Part: "@DB/TC10000021852/--F" &LOG Cloning_Action: RETAIN &LOG Part: "@DB/TCCP000010713/--A" &LOG &LOG... (5 Replies)
Discussion started by: KarmaPoliceT2
5 Replies
ctype(3C)																 ctype(3C)

NAME
ctype: isalnum(), isalpha(), isascii(), isblank(), iscntrl(), isdigit(), isgraph(), islower(), isprint(), ispunct(), isspace(), isupper(), isxdigit() - classify characters according to type SYNOPSIS
DESCRIPTION
These functions classify character-coded integer values according to the rules of the coded character set identified by the last successful call to (see setlocale(3C)). Each function is a predicate returning nonzero for true, zero for false. If has not been called successfully, characters are classified according to the rules of the default ASCII 7-bit coded character set (see setlocale(3C)). is defined on all integer values; the other functions are defined for the range (EOF) through RETURN VALUE
The functions return nonzero under the following circumstances; zero otherwise: c is an alphanumeric (letters or digits). c is a letter. c is any ASCII character code between 0 and 0177, inclusive. c is a blank character; that is, a space or a tab. c is a control character (in ASCII: character codes less than 040 and the delete character(0177)). c is a decimal digit (in ASCII: characters [0-9]). c is a visible character (in ASCII: printing characters, excluding the space character(040)). c is a lowercase letter. c is a printing character. c is a punctuation character (in ASCII: any printing character except the space character(040), digits, letters). c is a character that creates whitespace in displayed text (in ASCII: space, tab, carriage return, newline, verti- cal tab, and formfeed). c is an uppercase letter. c is a hexadecimal digit (in ASCII: characters [0-9], [A-F] or [a-f]). If the argument to any of these functions is outside the domain of the function, the result is undefined. EXTERNAL INFLUENCES
Environment Variables The category determines the classification of character type. International Code Set Support Single-byte character code sets are supported. WARNINGS
These functions are supplied both as library functions and as macros defined in the header. Normally, the macro versions are used. To obtain the library function, either use a to remove the macro definition or, if compiling in ANSI-C mode, enclose the function name in parenthesis or take its address. The following example uses the library functions for and AUTHOR
was developed by IBM, OSF, and HP. SEE ALSO
setlocale(3C), ascii(5), thread_safety(5). STANDARDS CONFORMANCE
ctype(3C)
All times are GMT -4. The time now is 01:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy