Sponsored Content
Full Discussion: Remove char after Colon
Top Forums Shell Programming and Scripting Remove char after Colon Post 302514726 by gowrishankar05 on Sunday 17th of April 2011 08:25:23 PM
Old 04-17-2011
Remove char after Colon

Hi guys,

This is my input
Code:
2735:<7001> 34 789 701                                                               2
2774:<7001> 34 789 701                                                               2

How to delete characters after colon :
Including colon : too ?

My output should look like
Code:
2735
2774

Any help is appreciated...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove a colon and number and leaving the rest

just have a file 1:2333 2:-09393 ]3:45453 4:-09999 5:-09933 6:93939 question is to get output by removing colons as well as number before each colon (in bold) 2333 -09393 45453 -09999 09933 93939 (5 Replies)
Discussion started by: cdfd123
5 Replies

2. Shell Programming and Scripting

How to remove new line char from a string

Hi Can anyone tell me how can i remove new line character from a string. My requirement is to read a line from a file and store it to a string. read line string1=$line read line string2=$line echo $string1$string2 The result i am getting in different line. i want the output in the same... (1 Reply)
Discussion started by: sreedivia
1 Replies

3. Shell Programming and Scripting

Help needed to remove a char from a specified sub-string

Hi! I'm having trouble usind sed to remove the char ' from within a database's varchar register's sql. For example, on the following sql: INSERT INTO patrimonio_municipal.patrimonio_municipal_airc_tmp Values('|Estação Elevatória|',|16723|,'|Grandes Reparações|', '|2010-03-26... (3 Replies)
Discussion started by: cremat0rio
3 Replies

4. Shell Programming and Scripting

can I remove the first char using AWK?

Hi everyone, suppose that I have the following line: #test your knowledge can I use AWK to print the word "test" only? without the #? what should I change to this: awk '{print $1}' thanks in advance guys (2 Replies)
Discussion started by: Abdulelah
2 Replies

5. UNIX Desktop Questions & Answers

Help me to remove junk char

I wanted to remove junk char in my csv. :mad: Input file format: "17","9986782190","0","D","2" "17","9900918331","0","D","2" "13","9986782194","0","A","2" Output file format 9986782190 9900918331 9986782194 And one more thing all the time "13"," this will be different Ex: . (2 Replies)
Discussion started by: Siddartha
2 Replies

6. Red Hat

How to remove a special char using sed

consider this is my sample file format. in this i want to remove ^@ with space . please help me in this problm 7305,1310184890,0,0,12,201370,FCASTBHBR0 ,XX ,2,1,2,0,^@,1,1,0,3,1303862400,0,1577923199,1,10,FCASTOR SEED EX-BHABHAR ... (2 Replies)
Discussion started by: ponmuthu-lnx
2 Replies

7. Shell Programming and Scripting

Bash, remove numbers after colon

Hello All, I was wondering if someone might know how to do this. I have a word list that is format like the example below. I need to take away the :number after that... is there some kind of command I could use to remove them? 123456:5562 password:1507 123456789:989 qwerty:877... (7 Replies)
Discussion started by: 3therk1ll
7 Replies

8. UNIX for Dummies Questions & Answers

Remove newline char from variable

I have a file ABC.DAT with 2 columns avaialble Data format : XYZ!$#$!120 XXZ!$#$!1000 YYZ!$#$!104 While running the following code : FILE_COUNTER=1; RECORD_CN_FILE_COUNT=$((`wc -l ABC.DAT| cut -f1 -d' '`)); while do FILE_NAME=`cat ABC.DAT.DAT| head -$FILE_COUNTER |tail -1 | awk -F... (1 Reply)
Discussion started by: Nikhil Gautam
1 Replies

9. UNIX for Dummies Questions & Answers

Remove char if not a number

I need to write a BASH script that takes a 2 character string and removes the second character if it is not a digit e.g. If the string is numberical value >9 e.g. string1 = '34' then leave string1 = '34'. However if the string is <10 e.g. string1 = '3X' then remove the second char (which... (7 Replies)
Discussion started by: millsy5
7 Replies

10. UNIX for Advanced & Expert Users

How to remove a char before a pattern?

Hi I have a file where i want to remove a char before a specific pattern. exp: CREATE TABLE ( A, B, C, ----comma needs to be removed )AS SELECT A, B, C, ----comma needs to be removed FROM TABLE. So i want to delete the comma(,) after the C both ways.Pattern can be... (11 Replies)
Discussion started by: raju2016
11 Replies
tbl(1)							      General Commands Manual							    tbl(1)

Name
       tbl - format tables for nroff or *roff

Syntax
       tbl [files...]

Description
       The  preprocessor  is used for formatting tables for or The input files are copied to the standard output, except for lines between .TS and
       .TE command lines, which are assumed to describe tables and are reformatted.

Options
       -TX     Produces output without fractional line motions.  Use when the destination output device or printer or  post-filter  cannot  handle
	       fractional line motions.

       -ms     Reads in macros prior to table formatting.

       -mm     Reads in the macros prior to table formatting, if your system has the macros installed.

Examples
       As an example, letting 	 represent a tab (which should be typed as a genuine tab) the input

	      .TS
	      c s s
	      c c s
	      c c c
	      l n n.
	      Household Population
	      Town	Households
	      	Number	Size
	      Bedminster	789	3.26
	      Bernards Twp.	3087	3.74
	      Bernardsville	2018	3.30
	      Bound Brook	3425	3.04
	      Branchburg	1644	3.49
	      Bridgewater	7897	3.81
	      Far Hills	240	3.19
	      .TE

       yields

		  Household Population
		  Town	       Households
			      Number   Size
	      Bedminster	789    3.26
	      Bernards Twp.    3087    3.74
	      Bernardsville    2018    3.30
	      Bound Brook      3425    3.04
	      Branchburg       1644    3.49
	      Bridgewater      7897    3.81
	      Far Hills 	240    3.19

       If  no  arguments are given, reads the standard input, so it may be used as a filter.  When is used with or the command should be first, to
       minimize the volume of data passed through pipes.

See Also
       nroff(1)
       "Tbl - A Program to Format Tables," ULTRIX Supplementary Documents, Vol. I:General User

																	    tbl(1)
All times are GMT -4. The time now is 06:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy