Sponsored Content
Top Forums Shell Programming and Scripting Delete characters from each line until meet character ":" Post 302642367 by black_fender on Thursday 17th of May 2012 10:24:10 AM
Old 05-17-2012
Delete characters from each line until meet character ":"

Hello,

I have file that looks like this :

Code:
765327564:line1
94:line2
7865:line3
.....
765322:linen

I want to cut all the digits from the beginning of each line up to ":" character and to have everything like this :

Code:
line1
line2
line3
.....
linen

P.S : content of line1 ... linen may contain ":" character so to eliminate what I don;t want from each line with echo $line | cut -d ":" -f 2 will not work well.


any ideas?

THX.

Last edited by Scrutinizer; 05-17-2012 at 12:25 PM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

deleting newline characters but not the "true" \n character

hi, i have a file that has about 4500 rows. this was an old microsoft access databse and what i am trying to do is take out the old extra \n newline characters but not take out the "true" newline character. I will explain. i was trying to write a regular expression, but that was not... (1 Reply)
Discussion started by: caddyjoe77
1 Replies

2. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

3. Shell Programming and Scripting

How to remove "New line characters" and "spaces" at a time

Dear friends, following is the output of a script from which I want to remove spaces and new-line characters. Example:- Line1 abcdefghijklmnopqrstuvwxyz Line2 mnopqrstuvwxyzabcdefghijkl Line3 opqrstuvwxyzabcdefdefg Here in above example, at every starting line there is a “tab” &... (4 Replies)
Discussion started by: anushree.a
4 Replies

4. UNIX for Dummies Questions & Answers

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

5. UNIX for Advanced & Expert Users

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Shell Programming and Scripting

finding the strings beween 2 characters "/" & "/" in .txt file

Hi all. I have a .txt file that I need to sort it My file is like: 1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO) 2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies

8. Shell Programming and Scripting

Find "*.c" and "Makefile" and then delete them with one line

find "*.c" and "Makefile" and then delete them with one line (3 Replies)
Discussion started by: yanglei_fage
3 Replies

9. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies

10. UNIX for Beginners Questions & Answers

Delete a "G" character from df -h result

Hello everybody, I'm a new user in forum, In a script, i would like that the result sort : /usr - 665 Go (free: 631 Go / 6% used) but i obtain : /usr - 665G Go (free: 631G Go / 6% used) My command line is : RES_DF=`df -BG /usr/ | tail -n1 | awk -vOFS='' '{print $5, " - ", $1, "... (5 Replies)
Discussion started by: xnyp
5 Replies
cam(1)							      General Commands Manual							    cam(1)

NAME
cam - CPU'S AUDIO MIXER for Linux SYNOPSIS
cam [-v x,y] [--volume x,y] [-b x,y] [--bass x,y] [-t x,y] [--treble x,y] [-s x,y] [--synth x,y] [-p x,y] [--pcm x,y] [-S x,y] [--speaker x,y] [-l x,y] [--line x,y] [-m x,y] [--mic x,y] [-c x,y] [--cd x,y] [-M x,y] [--mixer x,y] [-a x,y] [--altpcm x,y] [-r x,y] [--reclev x,y] [-i x,y] [--igain x,y] [-o x,y] [--ogain x,y] [-l1 x,y] [--line1 x,y] [-l2 x,y] [--line2 x,y] [-l3 x,y] [--line3 x,y] [-3d 1|0] [--3dse 1|0] [-agc 1|0] [--agc 1|0] [-h] [-?] [--help] [-get] [-save] [-getfile filename] [-savefile filename] xcam DESCRIPTION
This is an audio mixer for Linux. You have the choice to use it with an interface or at the command line. OPTIONS
When using the interface you can use the following keys : LEFT ARROW decrease the volume of the current device. RIGHT ARROW increase the volume of the current device. UP ARROW go to previous device. DOWN ARROW go to next device. L locks or unlocks : unlocked : you can control the left and right channel separately. lock : left and right channel are controlled together. R turn on/off recording mode : red lamp : recording turned on green lamp : recording turned off 3 turn on/off 3D Stereo Enhancement (3DSE) device : when turned on green indicator 3D will be lit at the left side of main volume handle. A turn on/off microphone Automatic Gain Control : when turned on green indicator AGC will be lit at the left side of microphone volume handle. S save the settings of ALL devices in a file ($HOME/.camrc) G loads the saved settings and restores them. H shows the help screen. Q/ESC exits the program and returns to shell. NOTE: you can use upper or lower case. When using the command line options the interface is not shown. The following options are available : -v, --volume x,y Set 'volume' to x (left) and y (right) -b, --bass x,y Set 'bass' to x (left) and y (right) -t, --trebble x,y Set 'treble' to x (left) and y (right) -s, --synth x,y Set 'synth' to x (left) and y (right) -p, --pcm x,y Set 'pcm' to x (left) and y (right) -S, --speaker x,y Set 'speaker' to x (left) and y (right) -l, --line x,y Set 'line in' to x (left) and y (right) -m, --mic x,y Set 'microphone' to x (left) and y (right) -c, --cd x,y Set 'CD in' to x (left) and y (right) -I, --imix x,y Set 'mixer' to x (left) and y (right) -a, --altpcm x,y Set 'altpcm' to x (left) and y (right) -r, --reclev x,y Set 'record level' to x (left) and y (right) -i, --igain x,y Set 'input gain' to x (left) and y (right) -o, --ogain x,y Set 'output gain' to x (left) and y (right) -l1, --line1 x,y Set 'line 1' to x (left) and y (right) -l2, --line2 x,y Set 'line 2' to x (left) and y (right) -l3, --line3 x,y Set 'line 3' to x (left) and y (right) -3d, --3dse 1|0 Set 3D Stereo Enhancement to 1 (on) or 0 (off) -agc, --agc 1|0 Set Automatic Gain Control for microphone to 1 (on) or 0 (off) -get restore the saved values from $HOME/.camrc -save save the values to $HOME/.camrc -getfile filename restore the saved values from file 'filename' -savefile filename save the values to file 'filename' -h, -?, --help displays help NOTE: x and y are in range from 1 to 100. Higher or lower numbers are ignored. BUGS
None known as yet. If you find one, please let me know. AUTHOR
Jan 'TWP' VANDENBERGHE <jvdbergh@uia.ua.ac.be> cam(1)
All times are GMT -4. The time now is 01:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy