Sure you can help this poor guy that is struggling against sed command, being unable to tame it
I have a lot of files like this:
Quote:
$ cat S_CAP0010001_20111118_122041.log
JOB: S_CAP0010001
FICHERO ENTRADA: S1.PSPER.BCJ.CAP001.F0001
FICHERO SALIDA DATOS: A153895.DS.VYP.BCJ.CAP001.S0001.SMSSTD
FICHERO SALIDA NO MATCH PARES: A153895.DS.VYP.BCJ.CAP001.S0001.ERROR.SMSSTD
HORA COMIENZO: 2011-11-18 12:20:41 CABECERA: I2077CAP0010001 00000000000251220111117215811
PIE: 000000004008848
FILAS ENTRADA (contando carcasa, cabecera y pie): 4008850
FILAS FICHERO SALIDA (contando cabecera y pie): 4007593
FILAS FICHERO NO MATCHS: 1255
HORA FIN: 2011-11-18 12:27:33 STATUS: 2( Finalizado OK con warnings )
From this one, I need to obtain values highlighted in bold/red
To do so, I am executing this piece of code inside a loop:
And the response is being the following:
Quote:
S_CAP0010001;2500;4008850;2011-11-18;2011-11-18
S_CAP0010002;2500;1629608;2011-11-18;2011-11-18
S_CAP0010008;2500;8654037;2011-11-18;2011-11-18
S_GIE0010008;157;JOB: S_GIE0010008 FICHERO ENTRADA: S1.PSPER.BCJ.GIE001.F0008 FICHERO SALIDA DATOS: CPPGITB.DS.VAL.BCJ.GIE001.S0008.SMSSTD FICHERO SALIDA NO MATCH PARES: CPPGITB.DS.VAL.BCJ.GIE001.S0008.ERROR.SMSSTD HORA COMIENZO: 2011-11-10 12:40:14 CABECERA: I2077GIE0010008 00000000000016920111104134502 PIE: 000000000007316 HORA FIN: 2011-11-10 12:44:08 STATUS: 2( Finalizado OK con warnings );2011-11-10;2011-11-10
So I am facing two problems here:
1) I need to get everything after 'HORA COMIENZO: ', but I am getting only whatever it is between that and next space
2) When the file I am checking is missing some of the lines I am looking for, I am getting the whole file. Instead of that, I should get null value for that (in the last case of my example, there is no line starting with 'FILAS ENTRADA (contando carcasa, cabecera y pie):' . In such case, I should just show no value, empty space or something like that
hi people,
i'm having a hard time trying to extract a list of vars delimited by section inside a ini file ...
let's consider this ini file :
; config file
DESC = "channel synchro TGG01"
DMM_VER = DMM23
PATH_FIFO = /users/tgg00/fifo
QRT = BTS01.TGG.01.2
MODE_TRACE... (5 Replies)
I have a large xml file as shown below:
<input>
<blah>
<blah>
<atr="blah blah value = "">
<blah>
<blah>
</input>
..2nd chunk...
..3rd chunk...
...4th chunk...
All lines between <input> and </input> is one 'order' and this 'order' is repeated... (14 Replies)
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)
Yes, there is a great doc out there that discusses parsing csv files with sed, and this topic has been covered before but not enough to answer my question (unix.com forums).
I'm trying to parse a CSV file that has optional quotes like the following:
"Apple","Apples, are fun",3.60,4.4,"I... (3 Replies)
Hi,
I am trying to use arrays in my script but can not seem to get it to work.
I have a file called sections, this contains headers from a tripwire log file, separated by "@" but could be "," if easier
The headers will be used to cut sections from the log file into another to be mailed.
... (5 Replies)
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)
Hi All,
I have this(.xml) file as:
<!-- define your instance here -->
<instance name='ins_C2Londondev' user='' group='' fullname='B2%20-%20London%20(dev)' >
<property>
</property>
</instance>
I want output as:
<!-- define your instance here -->
<instance... (3 Replies)
I had posted this earlier about 3 weeks ago and had recieved a response and I did sort both the files and the comm command is still not working.
Can someone please assist me, I would really appreciate it.
Below is what I am trying to do
I need to compare File A with File B and create FILE C... (2 Replies)
Hi,
I am struggling with the following... I try to grep out information of a text file I got with lynx, a text browser. The text file I get from lynx with dump is attached in the bottom.
What I would like to get is another file containing the astro-ph/98324 (number) and title and list of... (13 Replies)