Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Cut fields between delimiters Post 302885397 by sea on Saturday 25th of January 2014 07:12:59 PM
Old 01-25-2014
I dont know a better way to 'show':

Code:
echo "john:123456:123:456:doe
john:123456:123:doe"|sed s,":456","",g|cut -d: -f1,4

In case of a file it'll be more like:
Code:
grep john /input/file|sed s,":456","",g|cut -d: -f1,4

hth
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cut Last 3 Fields

I have a text: dsj khfksjdh <time> EST 2006 ab cgnr jkkjt <time> EST 2006 gfhdgjghg <time> EST 2006 fkdjh kjhsekjrh kdjhfkh jhdfkhfdkjh kjdf <time> EST 2006 In the above file i need to extract time from every line... which is always the third from the last... Pls help! Cheers, Bouren (4 Replies)
Discussion started by: bourne
4 Replies

2. Shell Programming and Scripting

Cut based on Two Delimiters at one go

Hi I wanted to cut the feilds comming after % and After $ at one go can we do some thing like this cut -f 2 -d "%|$" (But it doesnot work) Input File BWPG %TCPRP1 $SCSPR000 BWPH %TCPRP1 $SCSPR003 BWPI %TRTYUP ResourceDescription="IMPRIMANTE " $BWOPTY BWPJ %ZOMBIE ... (4 Replies)
Discussion started by: pbsrinivas
4 Replies

3. Shell Programming and Scripting

awk sed cut? to rearrange random number of fields into 3 fields

I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want. The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
Discussion started by: axo959
4 Replies

4. Shell Programming and Scripting

cut -- line with no delimiters

I just discovered, to my dismay, the following part of the cut man page: -f, --fields=LIST select only these fields; also print any line that contains no delimiter character, unless the -s option is specified The -s option toggles the printing of lines with no delimiters. In most... (3 Replies)
Discussion started by: chlorine
3 Replies

5. Shell Programming and Scripting

Inserting additional comma delimiters in a csv file, after and before certian fields.

Hello I have a csv file which I need to insert addtional commas into. The csv is of the format field1,field2,field3,field4,...etc...,field13,field14 I need to add extra commas in each record so that the final output looks like ... (1 Reply)
Discussion started by: kamal_p_99
1 Replies

6. Shell Programming and Scripting

awk: Print fields between two delimiters on separate lines and send to variables

I have email headers that look like the following. In the end I would like to accomplish sending each email address to its own variable, such as: user1@domain.com='user1@domain.com' user2@domain.com='user2@domain.com' user3@domain.com='user3@domain.com' etc... I know the sed to get rid of... (11 Replies)
Discussion started by: tay9000
11 Replies

7. Shell Programming and Scripting

Cut counting consecutive delimiters as fields

When cut encounters consecutive delimiters it seems to count each instance as a field, at least with spaces. Is this typical behavior for any delimiter? #:~$ ifconfig eth0 | grep HWaddr eth0 Link encap:Ethernet HWaddr 94:de:80:a7:6d:e1 #:~$ ifconfig eth0 | grep HWaddr | cut -d " " -f... (6 Replies)
Discussion started by: Riker1204
6 Replies

8. UNIX for Beginners Questions & Answers

Cut command: can't make it cut fields

I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 Replies

9. Shell Programming and Scripting

Getting fields from a file having multiple delimiters

Hi All, I have a file with a single row having the following text ABC.ABC.ABC,Database,New123,DBNAME,F,ABC.ABC.ABC_APP,"@FUNCTION1("ENT1") ,@FUNCTION2("ENT2")",R, I want an output in the following format ABC.ABC.ABC DBNAME ABC.ABC.ABC_APP '@FUNCTION1("ENT1")... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies

10. Shell Programming and Scripting

Cut between two delimiters, / and .

BASH : I have a very long list I am parsing through: 10/10/19... (5 Replies)
Discussion started by: jeffs42885
5 Replies
STROKES(5)							File Formats Manual							STROKES(5)

NAME
Strokes - X(1) action invocation with simple mouse movements DESCRIPTION
What are strokes? Simply put, they are a method to invoke program actions with mouse drags. They are defined by the following grid: 1 2 3 4 5 6 7 8 9 Stroke 456 is the horizontal movement from left to right with the stroke button pressed. Holding down the stroke button and tracing out the letter `C' would be stroke 3214789. Simple, right? The Stroke library allows you to add strokes to any X(1) program with one simple function call, StrokeInstall(3). For example: W = XmCreateMessageDialog(Parent, "StrokeEnabledDialog", NULL, 0); StrokeInstall(W); will enable strokes in the dialog W. When a stroke is entered the action corresponding to the stroke is called. For the above example the action `Stroke-456' would be called when `456 is stroked'. In order to specify a different action you can specify this with the `strokes' resource for the Widget that the strokes have been installed in. So `*StrokeEnabledDialog.strokes: 456 ManagerGadgetSelect' would call the ManagerGadgetSelect action of the message dialog when 456 is stroked. The exact syntax is: Resource.strokes: stroke action [[,stroke action]...] Resources strokes: stroke action [[,stroke action]...] This provides a mapping of strokes to actions. By default the action `Stroke-456' is called for stroke `456'. strokeSlop: int This is used to define a buffer zone between the boxes of the grid. The amount of slop tolerated is actually the resulting box dimension divided by this slop number. Therefore the larger the slop number the more accurate your strokes must be. A value approaching 3 will make it all but impossible to recognize a stroke. The default value is currently 20. Run the stroke(1) program with StrokeDebug turned on to show what this means. strokeDebug: True | False Turns on `stroke debug mode'. In this mode the strokes are not erased from the screen when the button is released and a grid is drawn around the stroke. Try the stroke(1) program to see what I mean. strokeButton: 1 | 2 | 3 | 4 | 5 Specifies the button to be used to draw strokes. By default Btn3 is used. strokeSound: sound file If given, the contents of this resource will be provided as an argument to the `PlaySound' action at the conclusion of the stroke. If the PlaySound action is not defined in your application do not specify this resource. Specifically the following call is made: XtCallActionProc(W, "PlaySound", NULL, "sound file", 1); AUTHOR
Rick Scott <rwscott@alumni.uwaterloo.ca> Check out LessTif at http://www.LessTif.org SEE ALSO
stroke(1) StrokeInstall(3) StrokeRemove(3) StrokeSetButton(3) StrokeGetButton(3) StrokeSetDebug(3) StrokeGetDebug(3) StrokeSetMapping(3) StrokeGetMapping(3) STROKES(5)
All times are GMT -4. The time now is 09:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy