Sponsored Content
Top Forums Shell Programming and Scripting Parsing out data with multiple field separators Post 303005382 by bakunin on Tuesday 17th of October 2017 01:39:23 PM
Old 10-17-2017
Quote:
Originally Posted by ncwxpanther
I have a large file that I need to print certain sections out of.
The basic problem is that you need to define what a "section" is: the line you presented uses different separators to delimit what i suppose is a "section" in your wording: spaces (or maybe tabs), dots, slashes and colons.

Will these four (five) characters always be delimiters?

Will the lines always have the same structure? (like "First 7 parts separated by "/", the seventh part consists of 6 parts separated by ".", then a colon, then ....")

If you could answer these questions we could perhaps provide better solutions which might work better. Without this information we will never be sure to have really solved the problem.

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk Multiple Field Separators

Hi Guys, I'm tying to split a line similar to this:YO6-2000-30.htm: (3 properties found).......into separate columns, so effectively I need to check for a -, ., :, a tab and a space in the statement. Any help would be appreciated Thanks! (7 Replies)
Discussion started by: Tonka52
7 Replies

2. Shell Programming and Scripting

I need help counting the fields and field separators using Nawk

I need help counting the fields and field separators using Nawk. I have a file that has multiple lines on it and I need to read the file 1 at a time and then count the fields and field separators and then store those numbers in variables. I then need to delete the first 5 fields and the blank... (3 Replies)
Discussion started by: scrappycc
3 Replies

3. Shell Programming and Scripting

Multiple input field Separators in awk.

I saw a couple of posts here referencing how to handle more than one input field separator in awk. I figured I would share how I (just!) figured out how to turn this line in a logfile: 90000000000000000000010001 name... (4 Replies)
Discussion started by: kinksville
4 Replies

4. UNIX for Dummies Questions & Answers

Multiple field separators in awk? (First a space, then a colon)

How do I deal with extracting a portion of a record when multiple field separators are involved. Let's say I have: Mike Harrington;(555) 555-5555:250:100:175 Christian Dobbins;(555) 555-2358:155:90:201 Susan Dalsass;(555) 555-6279:250:60:50 Archie McNichol;(555) 555-1348:250:100:175 Jody... (3 Replies)
Discussion started by: doubleminus
3 Replies

5. Shell Programming and Scripting

Fixed width file with newline field separators

I have some huge files that are produced daily from a production system written in basic (really). The files are fixed width records, 512 bytes, with newline field separators, newlines if the field is null, and trailing newlines for null fields. The data in the fields can be any ascii... (0 Replies)
Discussion started by: vtischuk@yahoo.
0 Replies

6. Shell Programming and Scripting

Problem with changing field separators in a file

I have a file with content as shown below. cat t2 : 100,100,"X",1234,"12A",,,"ab,c" Comma is the field seperator, however string fields will be within double quotes and comma within double quotes should not be treated as field seperator. I am trying to replace this field seperator to a... (7 Replies)
Discussion started by: mk1216
7 Replies

7. UNIX Desktop Questions & Answers

awk Varing Field Separators

Hi Guys, I have small dilemma which I could do with a little help solving . I currently have text HDD S.M.A.R.T report which I have pasted below: smartctl 5.39 2008-10-24 22:33 (openSUSE RPM) Copyright (C) 2002-8 by Bruce Allen, http://smartmontools.sourceforge.net Device: COMPAQ... (2 Replies)
Discussion started by: bikerben
2 Replies

8. UNIX for Dummies Questions & Answers

Can one use 2 field separators in awk?

I have files such as n02-z30-dsr65-terr0.25-dc0.008-16x12drw-run1.cmd I am wondering if it is possible to define two field separators "-" and "." for these strings so that $7 is run1. (5 Replies)
Discussion started by: kristinu
5 Replies

9. Shell Programming and Scripting

Multiple long field separators

How do I use multiple field separators in awk? I know that if I use awk -F"", both a and b will be field separators. But what if I need two field separators that both are longer than one letter? If I want the field separators to be "ab" and "cd", I will not be able to use awk -F"". The ... (2 Replies)
Discussion started by: locoroco
2 Replies

10. Shell Programming and Scripting

Extract lines with min value, using two field separators.

I have a file with two ID columns followed by five columns of counts in fraction form. I'd like to print lines that have a count of at least 4 (so at least 4 in the numerator, e.g. 4/17) in at least one of the five columns. Input file: comp51820_c1_seq1 693 0/29 0/50 0/69 0/36 0/31... (6 Replies)
Discussion started by: pathunkathunk
6 Replies
vbox.conf(5)						    Linux System Administration 					      vbox.conf(5)

NAME
vbox.conf - config file for vbox Description This file is used to configure when and on what conditions calls are taken. It can also be used to define which CALLERID is used with which person. Everything after the "#" is ignored, as are empty lines. All arguments must be separated by whitespace (spaces, tabs). Arguments may not contain whitespace. This file consists of several sections. A section begins with "[" NAME "]". The section name is case insensitive. A section ends at the end of the file or at the end of a new section. These sections exist: [CALLERIDS] This section maps CALLERID to persons and what settings to use. On an incoming call the CALLERID of the caller is detected and compared with this section. The SECTION of the first match is used. Format : PATTERN SECTION REALNAME PATTERN UN*X Pattern of a CALLERID. You may not use whitespace. SECTION Name of a user section to use. You many not use whitespace. With a "-" STANDARD will be used, with a "*" the REALNAME will be used. REALNAME Full name of the person that should be mapped to the CALLERID. Here you may use spaces. At the end of the [CALLERIDS] Section, you should have the entry "* - *** Unknown ***", so that also calls with no or unknown CAL- LERID can be processed. [RINGS] In this section you set when and after how many RINGs a call is taken. This section is the first to be examined when a call is incoming to determine if the call should be taken. The number of RINGs can be overruled in the user section. Format : TIME DAYS RINGS TIME time when the call should be taken. Read the isdntime(5) man page for details. DAYS days when the call should be takes. Read the isdntime(5) man page for details. RINGS Number of rings to wait before taking the call. With version 2.0 of the hisax isdn device driver the interval between two rings is longer (now it's nearly like a telephone; 4 - 5 seconds between rings). user defined sections Here you can make individual settings for some people. The section name has the same format as the other sections. The names CAL- LERIDS and RINGS are reserved. Format : TIME DAYS MESSAGE RECTIME [FLAG] [...] TIME time when the call should be taken. Read the isdntime(5) man page for details. DAYS days when the call should be taken. Read the isdntime(5) man page for details. MESSAGE Standard message to play for this call. You must either give the filename with full path, or a filename relative to /var/spool/vbox/<user>/messages. Default is "standard.msg". You may not use spaces or tabs. RECTIME Time in seconds: how long should vboxgetty record? Default is 60 seconds. FLAGS You can additionally give these flags: NOANSWER Don't answer this call. Default is to answer. NORECORD Don't record a message. Default is to record. NOTIMEOUTMSG Don't play timeout message. Default is to play. NOBEEPMSG Don't play beep message. Default is to play. NOSTDMSG Don't play std message. Default is to play. RINGS= Number of rings to wait before taking the call. Here you can override the [RINGS] section. TOLLRINGS= Number of rings to wait before answering the call, if new messages are available. This flag overrides the section [RINGS] and the flag RINGS= if there are new messages. The directory to search for new messages must be given with TOLLCHECK (or you can use the default). TOLLCHECK= Directory to search for new messages. Default is /var/spool/vbox/<user>/incoming. SCRIPT= TCL-Script to start after taking the call. This must be the full path or a filename relative to /var/spool/vbox/<user>. The default is standard.tcl. FILES
/var/spool/vbox/<user>/vbox.conf this configuration file. /usr/share/doc/isdnvboxserver/examples/vbox.conf an example. SEE ALSO
isdntime(5) AUTHOR
This manual page was written by Andreas Jellinghaus <aj@dungeon.inka.de>, for Debian GNU/Linux and isdn4linux. Now maintained by Paul Slootman <paul@debian.org>. ISDN 4 Linux 3.25 2000/09/15 vbox.conf(5)
All times are GMT -4. The time now is 12:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy