Sponsored Content
Full Discussion: awk sed parsing
Top Forums Shell Programming and Scripting awk sed parsing Post 302174888 by radoulov on Wednesday 12th of March 2008 12:06:01 PM
Old 03-12-2008
Something like:

[GNU Sed]

Code:
sed 's/\("[^"]*"\|#.*\)//g' file

Other seds:

Code:
sed 's/"[^"]*"//g;s/#.*//' file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

parsing xml with awk/sed

Hi people!, I need extract from the file (test-file.txt) the values between <context> and </context> tag's , the total are 7 lines,but i can only get 5 or 2 lines!!:confused: Please look my code: #awk '/context/{flag=1} /\/context/{flag=0} !/context/{ if (flag==1) p rint $0; }'... (3 Replies)
Discussion started by: ricgamch
3 Replies

2. Shell Programming and Scripting

Parsing a file (sed/awk?)

Hello people, newbie question. I'm trying to parse these type of file 1 "CAR " " C1 " " " 6 0 C1 2 "CAR " " O1A" " " 8 0 O1A 3 "CAR " " O1B" " " 8 -1 O1B 4 "CAR " " C2 " " " 6 0 C2 5 "CAR " " C3 " " " 6 ... (10 Replies)
Discussion started by: aristegui
10 Replies

3. Shell Programming and Scripting

awk/sed for parsing file

Hi All, I have a log file like this E Mon Oct 06 00:17:08 2008 xxx2 cm:10614 fm_pi2_svc_iptv_purchase.c:149 1:pin_deferred_act:10601:11:169:1223245028:16 pi2_op_svc_iptv_purchase error <location=PIN_ERRLOC_FM:5 class=PIN_ERRCLASS_SYSTEM_DETERMINATE:1... (10 Replies)
Discussion started by: subin_bala
10 Replies

4. Shell Programming and Scripting

String parsing with awk/sed/?

If I have a string that has some name followed by an ID#(ex.B123456) followed by some more #'s and/or letters, would it be possible to just grab the ID portion of this string? If so how? I am pretty new with these text tools so any help is appreciated. Example: "Name_One-B123456A-12348A" (2 Replies)
Discussion started by: airon23bball
2 Replies

5. Shell Programming and Scripting

Line Parsing using sed and awk

Hi Guys, I need help with processing data in a file, line by line. My file test.txt has X_Building_X5946/X0 BUT/U_msp/RdBuMon_d2_B_00 BUT/U_msp/FfRmDaMix_d2_Pi3 Test_Long xp=849.416 yp=245.82 xn=849.488 yn=245.82 w=0.476 l=0.072 fault_layer="Al_T01_Mod" $ $X=849416 $Y=245582... (2 Replies)
Discussion started by: naveen@
2 Replies

6. Shell Programming and Scripting

Another parsing line awk or sed problem

Hi, After looking on different forums, I'm still in trouble to parse a parameters line received in KSH. $* is equal to "/AAA:111 /BBB:222 /CCC:333 /DDD:444" I would like to parse it and be able to access anyone from his name in my KSH after. like echo myArray => display 111 ... (1 Reply)
Discussion started by: RickTrader
1 Replies

7. Shell Programming and Scripting

Parsing with awk or sed

I want to delete corrupt records from a file through awk or sed. Can anyone help me with this Thanks Striker Change subject to a descriptive one, ty. (1 Reply)
Discussion started by: Rahul_us
1 Replies

8. UNIX for Advanced & Expert Users

Parsing through a file with awk/sed

I don't necessary have a problem, as I have a solution. It is just that there may be a better solution. GOAL: Part one: Parse data from a file using the "\" as a delimiter and extracting only the last delimiter. Part two: Parse same file and extract everything but the last delimited item. ... (8 Replies)
Discussion started by: OrangeYaGlad
8 Replies

9. Shell Programming and Scripting

awk/sed line parsing

I'm new to shell programming, but I think I learn best by following an example. I'm trying to cook up an awk/sed script, but I obviously lack the required syntax skills to achieve it. The output that I get from running my ksh script looks like this: I need to search each numbered line for... (10 Replies)
Discussion started by: iskatel
10 Replies

10. UNIX for Advanced & Expert Users

Interesting awk/Perl/sed parsing challenge

I have a log with entries like: out/target/product/imx53_smd/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/bindings/V8HTMLVideoElement.cpp : target thumb C++: libwebcore <=... (8 Replies)
Discussion started by: glev2005
8 Replies
NEWSLOG(5)							File Formats Manual							NEWSLOG(5)

NAME
newslog - description of Usenet log files DESCRIPTION
Most log files created by Usenet programs reside in the /var/log/news directory and have a ``.log'' extension. Several versions are usu- ally kept with an additional extension such as ``.1'', ``.2'', etc. -- the higher the number, the older the log. The older versions are compressed. The scanlogs script and related utilities (see newslog(8)) are responsible for rotating and compressing these files. Some log files always have data, others only have data if there is a problem, and others are only created if a particular program is used or configuration parameter is set. The innstat script (see newslog(8)) monitors the size of all log files. The following files will only accumulate data under the direction of control.ctl(5): control.log miscctl.log newgroup.log rmgroup.log unwanted.log In order to create these files, the ``message'' and ``action'' fields of control.ctl should be chosen from the following table: Message Action Meaning all log=miscctl Log all messages by default default log=miscctl Log unknown messages newgroup doit=newgroup Create group and log message newgroup log=newgroup Log message rmgroup doit=rmgroup Remove group and log message rmgroup log=rmgroup Log message ``other'' doit=miscctl log and process the message ``other'' log=miscctl Log message Here, ``other'' refers to any other control message such as: checkgroups ihave sendme sendsys senduuname version The following is a list of log files. control.log This file maintains a count of the number of newgroup and rmgroup control messages seen for each newsgroup. The count is of the number of control messages with identical arguments, regardless if they were actually processed. All control arguments, including invalid ones, are counted. This file is updated by tally.control, which is invoked by scanlogs if either the newgroup or rmgroup logs exist. This file is not rotated. errlog This file contains the standard output and standard error of any program spawned by innd(8). The most common programs are the con- trol-message handlers found in /usr/lib/news/control. This file should be empty. Scanlogs will print the entire contents of this log file if it is non-empty. expire.log By default, when news.daily is going to expire old news articles, it writes the date to this file, followed by any output from expire(8) and the ending date. All lines but the first are indented four spaces. miscctl.log When control.ctl is configured as described above, all control messages except newgroup and rmgroup are appended to this file by writelog. There will be a summary line describing the message and the action taken, followed by the article indented by four spa- ces, and a blank line. newgroup.log When control.ctl is configured as described above, all newgroup messages are appended to this file using the same format as for mis- cctl.log. news This file logs articles received by innd. Scanlogs summarizes the rejected articles reported in this file. news.crit All critical error messages issued by innd are appended to this file via syslog(3). This log file should be empty. Scanlogs will print the entire contents of this log file if it is non-empty. You should have the following line in your syslog.conf(5) file: news.crit /var/log/news/news.crit news.err All major error messages issued by innd are appended to this file via syslog. This log file should be empty. Scanlogs will print the entire contents of this log file if it is non-empty. You should have the following line in your syslog.conf file: news.err /var/log/news/news.err news.notice All standard error messages and status messages issued by innd are appended to this file via syslog. Scanlogs uses the awk(1) script innlog.awk to summarize this file. You should have the following line in your syslog.conf file: news.notice /var/log/news/news.notice nntpsend.log The nntpsend(8) programs appends all status messages to this file. rmgroup.log When control.ctl is configured as described above, all rmgroup messages are appended to this file using the same format as for misc- ctl.log. unwanted.log This log maintains a count of the number of articles that were rejected because they were posted to newsgroups that do not exist at the local site. This file is updated by tally.unwanted and maintained in reverse numeric order (the most popular rejected group first). This file is not rotated. HISTORY
Written by Landon Curt Noll <chongo@toad.com> and Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.6, dated 1996/09/10. SEE ALSO
control.ctl(5), ctlinnd(8), expire(8), innd(8), news.daily(8), nntpsend(8), newslog(8). NEWSLOG(5)
All times are GMT -4. The time now is 08:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy