Sponsored Content
Top Forums Shell Programming and Scripting Parsing of file for Report Generation (String parsing and splitting) Post 302292196 by umar.shaikh on Friday 27th of February 2009 05:55:17 AM
Old 02-27-2009
Parsing of file for Report Generation (String parsing and splitting)

Hey guys,

I have this file generated by me... i want to create some HTML output from it.
The problem is that i am really confused about how do I go about reading the file.

The file is in the following format:

Code:
TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy BExpected=yyy CTime=xx CResult=yyy CExpected=yyy ....

The file can continue this way as long as it wants. The A type (for that matter any type) might be repeated again too.
But there would always be 3 fields for a given type, Time, Result and ExpectedResult.

I need to consolidate all of these values for all the different types (A, B, etc.) and create a tabular report for them.

Oh, yes, forgot to mention.... I'm using a shell based on zsh.

Thanks,
Umar
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

parsing a string

hi i am new to shelll scripting I need to parse a string like "abc,def,ghie,jkl" And assign them to some variables like hs1 = abc hs2 = def hs3 = ghi hs4 = jkl Please help (4 Replies)
Discussion started by: satish@123
4 Replies

2. Shell Programming and Scripting

Perl parsing compared to Ksh parsing

#! /usr/local/bin/perl -w $ip = "$ARGV"; $rw = "$ARGV"; $snmpg = "/usr/local/bin/snmpbulkget -v2c -Cn1 -Cn2 -Os -c $rw"; $snmpw = "/usr/local/bin/snmpwalk -Os -c $rw"; $syst=`$snmpg $ip system sysName sysObjectID`; sysDescr.0 = STRING: Cisco Internetwork Operating System Software... (1 Reply)
Discussion started by: popeye
1 Replies

3. Shell Programming and Scripting

Parsing out the logs and generating report

My file will contain following(log.txt): start testcase: config loading ...... error XXXX ..... end testcase: config loading, result failed start testcase: ping check ..... error ZZZZZ ..... error AAAAA end testcase: Ping check, result failed I am expecting below output. ... (4 Replies)
Discussion started by: shellscripter
4 Replies

4. Shell Programming and Scripting

String-parsing!

I need the perl solution for the following : $string="I LOVE INDIA" now, in a new string i need the first character of each word... that is string2 should be "ILN". (10 Replies)
Discussion started by: vijay_0209
10 Replies

5. Shell Programming and Scripting

String parsing

Hi, name=VDSL_TTV_ HN_SUB create coid=MA5603U phone=5678 portpolicy=APortSelectionPolicy rfu10=TTV rfu3=Dot1q sz7_portmode=VDSL2 rfu5=1234 srprofile.sy_profname=$ADSL_TTV_SubProfile1 I have a line like this. Its a single line.I need the output as name=VDSL_TTV_ HN_SUB create... (1 Reply)
Discussion started by: giri_luck
1 Replies

6. Shell Programming and Scripting

Need help on parsing string

for i in `cat list`;do lol=`curl -m 2 -s ${i} | grep 'class=info' | cut -d '>' -f14 | cut -d '<' -f1 | sed '/^$/d'`; if ;then echo "$i,$lol" >> dirty; echo "$i,$lol";fi; done cut: you must specify a list of bytes, characters, or fields Try `cut --help' for more information. it gave me that... (0 Replies)
Discussion started by: p33plime
0 Replies

7. Shell Programming and Scripting

Parsing a long string string problem for procmail

Hi everyone, I am working on fetchmail + procmail to filter mails and I am having problem with parsing a long line in the body of the email. Could anyone help me construct a reg exp for this string below. It needs to match exactly as this string. GetRyt... (4 Replies)
Discussion started by: cwiggler
4 Replies

8. Shell Programming and Scripting

Parsing diff output into report

Hello all; lat week I was able to get some assistance on creating a summary report from a file generated by a "comm" comparison of twp CSV files...turn out now that I am being asked for a detail report as well...this is beyond my knowledge of perl (and yes I have to use perl)..also please keep... (5 Replies)
Discussion started by: gvolpini
5 Replies

9. UNIX for Dummies Questions & Answers

Help on parsing Oracle RMAN output for string and print sections of a file

Hi, I need some advise on how to print 'sections' of the attached file. I am searching for some that says Marked Corrupt and print some lines after it. At the moment I am running the command below: sed -n -e '/Marked Corrupt/{N;N;p;}' rman_list_validate.txtThis gives me the following... (1 Reply)
Discussion started by: newbie_01
1 Replies

10. Shell Programming and Scripting

Parsing a log file and creating a report script

The log file is huge and lot of information, i would like to parse and make a report . below is the log file looks like: REPORT DATE: Mon Aug 10 04:16:17 CDT 2017 SYSTEN VER: v1.3.0.9 TERMINAL TYPE: prod SYSTEM: nb11cu51 UPTIME: 04:16AM up 182 days 57 mins min MODEL, TYPE, and SN:... (8 Replies)
Discussion started by: amir07
8 Replies
hp-setup(1)							   User Manuals 						       hp-setup(1)

NAME
hp-setup - Printer/Fax Setup Utility DESCRIPTION
Installs HPLIP printers and faxes in the CUPS spooler. Tries to automatically determine the correct PPD file to use. Allows the printing of a testpage. Performs basic fax parameter setup. SYNOPSIS
hp-setup [MODE] [OPTIONS] [SERIAL NO.|USB bus:device|IP|DEVNODE] MODE
Run in graphical UI mode: -u or --gui (Default) Run in interactive mode: -i or --interactive OPTIONS
Automatic mode: -a or --auto (-i mode only) To specify the port on a multi-port JetDirect: --port=<port> (Valid values are 1*, 2, and 3. *default) No testpage in automatic mode: -x (-i mode only) To specify a CUPS printer queue name: -p<printer> or --printer=<printer> (-i mode only) To specify a CUPS fax queue name: -f<fax> or --fax=<fax> (-i mode only) Type of queue(s) to install: -t<typelist> or --type=<typelist>. <typelist>: print*, fax* (*default) (-i mode only) To specify the device URI to install: -d<device> or --device=<device> (--qt4 mode only) Remove printers or faxes instead of setting-up: -r or --rm or --remove (-u only) Set the language: -q <lang> or --lang=<lang>. Use -q? or --lang=? to see a list of available language codes. Set the logging level: -l<level> or --logging=<level> <level>: none, info*, error, warn, debug (*default) Run in debug mode: -g (same as option: -ldebug) This help information: -h or --help SERIAL NO.|USB ID|IP|DEVNODE USB bus:device (usb only): "xxx:yyy" where 'xxx' is the USB bus and 'yyy' is the USB device. (Note: The ':' and all leading zeros must be present.) Use the 'lsusb' command to obtain this information. IPs (network only): IPv4 address "a.b.c.d" or "hostname" DEVNODE (parallel only): "/dev/parportX", X=0,1,2,... SERIAL NO. (usb and parallel only): "serial no." EXAMPLES
Setup using GUI mode: $ hp-setup Setup using GUI mode, specifying usb: $ hp-setup -b usb Setup using GUI mode, specifying an IP: $ hp-setup 192.168.0.101 One USB printer attached, automatic: $ hp-setup -i -a USB, IDs specified: $ hp-setup -i 001:002 Network: $ hp-setup -i 66.35.250.209 Network, Jetdirect port 2: $ hp-setup -i --port=2 66.35.250.209 Parallel: $ hp-setup -i /dev/parport0 USB or parallel, using serial number: $ hp-setup -i US12345678A USB, automatic: $ hp-setup -i --auto 001:002 Parallel, automatic, no testpage: $ hp-setup -i -a -x /dev/parport0 Parallel, choose device: $ hp-setup -i -b par NOTES
1. If no serial number, USB ID, IP, or device node is specified, the USB and parallel busses will be probed for devices. 2. Using 'lsusb' to obtain USB IDs: (example) $ lsusb Bus 003 Device 011: ID 03f0:c202 Hewlett-Packard $ hp-setup --auto 003:011 (Note: You may have to run 'lsusb' from /sbin or another location. Use '$ locate lsusb' to determine this.) 3. Parameters -a, -f, -p, or -t are not valid in GUI (-u) mode. SEE ALSO
hp-makeuri hp-probe AUTHOR
HPLIP (Hewlett-Packard Linux Imaging and Printing) is an HP developed solution for printing, scanning, and faxing with HP inkjet and laser based printers in Linux. REPORTING BUGS
The HPLIP Launchpad.net site https://launchpad.net/hplip is available to get help, report bugs, make suggestions, discuss the HPLIP project or otherwise contact the HPLIP Team. COPYRIGHT
Copyright (c) 2001-14 Hewlett-Packard Development Company, L.P. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to distribute it under certain conditions. See COPYING file for more details. Linux 9.0 hp-setup(1)
All times are GMT -4. The time now is 03:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy