Sponsored Content
Top Forums Shell Programming and Scripting --Parsing out strings for repeating delimiters for everyline Post 303040246 by vgersh99 on Friday 25th of October 2019 10:06:03 AM
Old 10-25-2019
Quote:
Originally Posted by gilgamesh
So further to this discussion, would there be a way to delete one complete field ??
For example, if wanting to remove the DESCR() field.

From:


To:


Tried the sed command:

Code:
sed 's/DESCR.*) R//'

But this strips the first char "R" next field, returning: NAME(BOS.FOS.T.CDG.MEDGTOC.01) XMITQ( )

Thnx again !!
Code:
echo 'QREMOTE(BOS.FOS.T.CDG.MEDGTOC.01) CLUSTER(CLENTT1) DEFBIND(NOTFIXED) DEFPSIST(YES) DESCR(Cargo dangerous goods queue) RQMNAME(CLCRGT1) RNAME(BOS.FOS.T.CDG.MEDGTOC.01) XMITQ( )' | sed 's/DESCR[^)]*)//g'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

parsing with multible delimiters

I have data that looks like this aaa!bbb!ccc/ddd/eee It is not fixed format. I need to parse ddd into a var in order to decide if I want to process that row. If I do I need to put ccc and bbb into vars to process it. I need to do this during a while loop one record at a time. Any... (11 Replies)
Discussion started by: gillbates
11 Replies

2. Shell Programming and Scripting

cut columns in everyline

Is there a betterway to cut certain columns in everyline based on positions. Basically, I have a largefile and eachline is of 1000 characters and I need to cut the characters 17-30, 750-775, 776-779, 780-805 while do fptr=`cat $tempfile | head -$i | tail -1` ... (4 Replies)
Discussion started by: gunaah
4 Replies

3. Shell Programming and Scripting

Parsing file to match strings

I have a file with the following format 12g data/datasets/cct 8g data/dataset/cct 10 g data/two 5g data/something_different 10g something_different 5g data/two is there a way to loop through this... (1 Reply)
Discussion started by: yawalias
1 Replies

4. Shell Programming and Scripting

Awk new datetime everyline

Hi, I'm using awk in HP-UX machine which does not support systime(), strftime(). So to get the date time I was using : seq 1 100000 | awk ' "date +%Y%m%d%H%M%s" | getline curtime; print curtime }' However the above code gets the date only once, next time it is not updated. For... (2 Replies)
Discussion started by: Random_Net
2 Replies

5. Shell Programming and Scripting

Parsing Strings

Hello All, I am new to shell scripting and programming. I am looking for a guide on how I can parse specific information from a plain text file with thousands of lines. Specifically I need to parse an email address from each line. The line looks something like this:... (9 Replies)
Discussion started by: solvdsystems
9 Replies

6. Shell Programming and Scripting

Extract strings within XML file between different delimiters

Good afternoon! I have an XML file from which I want to extract only certain elements contained within each line. The problem is that the format of each line is not exactly the same (though similiar). For example, oa_var will be in each line, however, there may be no value or other... (3 Replies)
Discussion started by: bab@faa
3 Replies

7. UNIX for Dummies Questions & Answers

Adding variables to repeating strings

Hello, I want to add a letter to the end of a string if it repeats in a column. so if I have a file like this: DOG001 DOG0023 DOG004 DOG001 DOG0023 DOG001 the output should look like this: DOG001-a DOG0023-a DOG004 DOG001-b (15 Replies)
Discussion started by: verse123
15 Replies

8. Shell Programming and Scripting

How to append server name to everyline?

I am executing df -mP to see the disk utilization. I would like to append servername also to each and every line. df -mP | awk '{ print $1","$2","$3","$4","$5","$6 }' trying to add something like this df -mP | awk '{ print $1","$2","$3","$4","$5","$6","$hostname }' ... (1 Reply)
Discussion started by: lazydev
1 Replies

9. Shell Programming and Scripting

Script to rename the repeating strings

All, I have a sample text like below. Key (Header) Key1 ABC Key2 ABC Key3 ABC ABC Key4 ABC Key5 ABC ABC ABC Required Output Key (Header) Key1 (2 Replies)
Discussion started by: ks_reddy
2 Replies

10. Programming

Segfault When Parsing Delimiters In C

Another project, another bump in the road and another chance to learn. I've been trying to open gzipped files and parse data from them and hit a snag. I have data in gzips with a place followed by an ip or ip range sort of like this: Some place:x.x.x.x-x.x.x.x I was able to modify some code... (6 Replies)
Discussion started by: Azrael
6 Replies
FOSMOUNT(1)							   User Commands						       FOSMOUNT(1)

NAME
fosmount - FOS mounter for fuse SYNOPSIS
fosmount [options] device mountpoint DESCRIPTION
FUSE extension for a read-only access on Smaky FOS. -h --help Display help message. -v --version Show version. -a --harddisk Force an hard disk instead of the autodetection. -f --floppydisk Force a floppy disk instead of the autodetection. -l --fos-logger Turn ON the FOS logger, fosmount will not be detached of the terminal. -d --fuse-debugger Turn ON the FUSE debugger, fosmount will not be detached of the terminal. -i --image-pbm Convert on the fly .IMAGE to .PBM (portable bitmap format). -j --image-xpm Convert on the fly .COLOR to .XPM (X Pixmap version 2). device /dev/fd0 for floppy disk /dev/sda for hard disk, etc, ... mountpoint Mount point for the FOS, like /mnt/smaky. AUTHOR
Written by Mathieu Schroeter <mathieu.schroeter@gamesover.ch>. REPORTING BUGS
Report bugs to <fosfat-devel@gamesover.ch>. COPYRIGHT
Copyright (C) 2006-2010 Mathieu Schroeter This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
fosmount(1) fosmount July 2009 FOSMOUNT(1)
All times are GMT -4. The time now is 08:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy