Sponsored Content
Top Forums Shell Programming and Scripting Grep or print each section of a file on one line with a separator Post 302841149 by gefa on Wednesday 7th of August 2013 04:33:54 AM
Old 08-07-2013
Grep or print each section of a file on one line with a separator

I can obtain information from itdt inventory command however it display as below, I'd like to print each entity on one line but seperated by :

the file is something like and each section ends with Volume Tag

Drive Address 256
Drive State ................... Normal
ASC/ASCQ ...................... 0000
Media Present ................. No
Robot Access Allowed .......... Yes
Source Element Address Valid .. No
Accessor Preferred Zone........ A (TS3500 only)
Media Inverted ................ No
Same Bus as Medium Changer .... Yes
SCSI Bus Address Valid ........ No
Logical Unit Number Valid ..... No
Volume Tag ....................
...

I would like the output to display something like

Drive Address 256Smilierive State Normal:Media Present Yes:and so on
Drive Address 257Smilierive State Normal:Media Present Yes: and so on
...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help find a section line of a file

hi, I have a 20 line file. I need a command which will brinf back a specific line based upon the line number I enter. e.g. the file looks like this and is called file1 jim is a man john is a woman james is a man wendy is a woman lesley is a woman i want a command that will... (4 Replies)
Discussion started by: sureshy
4 Replies

2. Shell Programming and Scripting

Awk+Grep Input file needs to match a column and print the entire line

I'm having problems since few days ago, and i'm not able to make it works with a simple awk+grep script (or other way to do this). For example, i have a input file1.txt: cat inputfile1.txt 218299910417 1172051195 1172070231 1172073514 1183135117 1183135118 1183135119 1281440202 ... (3 Replies)
Discussion started by: poliver
3 Replies

3. Shell Programming and Scripting

Extract section of file based on word in section

I have a list of Servers in no particular order as follows: virtualMachines="IIBSBS IIBVICDMS01 IIBVICMA01"And I am generating some output from a pre-existing script that gives me the following (this is a sample output selection). 9/17/2010 8:00:05 PM: Normal backup using VDRBACKUPS... (2 Replies)
Discussion started by: jelloir
2 Replies

4. Shell Programming and Scripting

Prepend first line of section to each line until the next section header

I have searched in a variety of ways in a variety of places but have come up empty. I would like to prepend a portion of a section header to each following line until the next section header. I have been using sed for most things up until now but I'd go for a solution in just about anything--... (7 Replies)
Discussion started by: pagrus
7 Replies

5. Shell Programming and Scripting

Print the first n line in each section

Hi, i have a file like this: ... 11111111 22222222 33333333 # 4444444 5555555 6666666 7777777 # ... i want just print the 2 first line between each section (each section is separated with "#"). so desired output would be like this: ... 11111111 22222222 (3 Replies)
Discussion started by: saeed.soltani
3 Replies

6. Shell Programming and Scripting

Grep in file and print in the line

hi # cat test.txt Test Date: 20131008 1515 -------------------------------------------------------------------------------------------------------------- Saxx = Proc_m0_s13 : 1640 Saxx = Proc_m0_s15 : 1791 Saxx = Proc_m0_s17 ... (2 Replies)
Discussion started by: justbow
2 Replies

7. UNIX for Dummies Questions & Answers

Grep file and print value only if the following line doesnt contain value xxxx

Hi All, I have some large files which I would like to obtain some data from, I want to grep (or alturnative method) out certain values hut only if the folowing line doesnt contain a certain value. I will explain better below showing an example print of the data. NE : V0001 NE : V0002... (6 Replies)
Discussion started by: mutley2202
6 Replies

8. Shell Programming and Scripting

Use two field separator in the same line and print them

Hi Guys, I have the file --- HOST_NAME,data_coleta,data_carga,CPU_util,CPU_idle,run_queue,memory,MEMORY_SYSTEM,MEMORY_TOTAL,MEMORY_SWAPIN,MEMORY_SWAPOUT,DISK_READ,DISK_WRITE,DISK_IO,NET_IN_PACKET, NET_OUT_PACKET... (4 Replies)
Discussion started by: antoniorajr
4 Replies

9. UNIX for Beginners Questions & Answers

Grep a section from an UNIX file obtaining only part of the data

Hello, I have a log file that has several sections "BEGIN JOB, End of job" like in the following example: 19/06/12 - 16:00:57 (27787398-449294): BEGIN JOB j1(27787398-449294) JOB1 19/06/12 - 16:00:57 (27787398-449294): DIGIT: 0 number of present logs : 1 19/06/12 - 16:00:57... (4 Replies)
Discussion started by: mvalonso
4 Replies

10. Shell Programming and Scripting

How to change file section into each line?

Hi Gurus, I have below file which has different sections, need to move the sections to beginning of the each record. original file aaa bbb ccc ddd eee fff output file. aaa bbb ccc ddd eee fff (6 Replies)
Discussion started by: green_k
6 Replies
UMASS(4)						   BSD Kernel Interfaces Manual 						  UMASS(4)

NAME
umass -- USB Mass Storage Devices driver SYNOPSIS
To compile this driver into the kernel, place the following line in your kernel configuration file: device scbus device usb device umass Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): umass_load="YES" DESCRIPTION
The umass driver provides support for Mass Storage devices that attach to the USB port. To use the umass driver, usb(4) and one of uhci(4) or ohci(4) must be configured in the kernel. Additionally, since umass uses the SCSI sub- system and sometimes acts as a SCSI device, it requires da(4) and scbus(4) to be included in the kernel. HARDWARE
The umass driver supports USB Mass Storage devices, including: o ADTEC Stick Drive AD-UST32M, 64M, 128M, 256M o Denno FireWire/USB2 Removable 2.5-inch HDD Case MIFU-25CB20 o FujiFilm Zip USB Drive ZDR100 USB A o GREEN HOUSE USB Flash Memory "PicoDrive" GH-UFD32M, 64M, 128M o Huawei Mobile (SD slot) o IBM 32MB USB Memory Key (P/N 22P5296) o IBM 256MB USB Drive (MSYSTEM DiskOnKey2) o IBM ThinkPad USB Portable CD-ROM Drive (P/N 33L5151) o I-O DATA USB CD/CD-R/CD-RW/DVD-R/DVD-RW/DVD-RAM/DVD-ROM Drive DVR-iUH2 (CDROM, DVD-RAM only) o I-O DATA USB x6 CD-RW Drive CDRW-i64/USB (CDROM only) o I-O DATA USB/IEEE1394 Portable HD Drive HDP-i30P/CI, HDP-i40P/CI o Iomega USB Zip 100/250 drive o Iomega Zip750 USB2.0 drive o Keian USB1.1/2.0 3.5-inch HDD Case KU350A o Kurouto Shikou USB 2.5-inch HDD Case GAWAP2.5PS-USB2.0 o LaCie P3 HardDrive USB 200GB o Logitec LDR-H443U2 DVD-RAM/-R/+R/-RW/+RW drive o Logitec Mobile USB Memory LMC-256UD o Logitec USB1.1/2.0 HDD Unit SHD-E60U2 o Logitec USB Double-Speed Floppy Drive LFD-31U2 o Logitec USB/IEEE1394 DVD-RAM/R/RW Unit LDR-N21FU2 (CDROM only) o MELCO USB Flash Disk "ClipDrive", RUF-C32M, -C64M, -C128M, -C256M, -C512M o MELCO USB Flash Disk "PetitDrive", RUF-32M, -64M, -128M, -256Mm o MELCO USB2.0 Flash Disk "PetitDrive2", RUF-256M/U2, -512M/U2 o MELCO USB2.0 MO Drive MO-CH640U2 o Matshita CF-VFDU03 floppy drive o Merlin SM300 MP3/WMA Player (256Mb) o Microtech International, Inc. USB-SCSI-HD 50 USB to SCSI cable o Motorola E398 Mobile Phone (TransFlash memory card) o NOVAC USB2.0 2.5/3.5-inch HDD Case NV-HD351U o PNY Attache Flash Drive o Panasonic ("Matshita FDD CF-VFDU03") o Panasonic KXL-CB20AN Portable DVD-ROM/CD-R/RW o Panasonic KXL-CB35AN (DVD-ROM & CD-R/RW) o Panasonic USB2.0 Portable CD-RW Drive KXL-RW40AN (CDROM only) o Panasonic floppy drive o Qware BeatZkey! Pro o RATOC Systems USB2.0 Removable HDD Case U2-MDK1, U2-MDK1B o SanDisk SDDR-31 (Compact Flash) o SanDisk SDDR-75 (only Compact Flash port works) o Sitecom CN-300 MultiFlash (MMC/SD, SmartMedia, CF, MemoryStick) o Sony Portable CD-R/RW Drive CRX10U (CDROM only) o TEAC Portable USB CD-ROM Unit CD-110PU/210PU o Time DPA20B MP3 Player (1Gb) o Trek Thumbdrive 8MB o VAIO floppy drive (includes Y-E Data Flashbuster-U) o Y-E Data floppy drive (720/1.44/2.88Mb) Among the supported digital cameras are: o Asahi Optical (PENTAX) Optio 230 & 330 EXAMPLES
device umass device scbus device da device pass Add the umass driver to the kernel. camcontrol rescan 0 Rescan a Zip drive that was added after boot. The command above assumes that the Zip drive is on the first SCSI bus in the system. camcontrol rescan 0:0:0 camcontrol rescan 0:0:1 camcontrol rescan 0:0:2 camcontrol rescan 0:0:3 Rescan all slots on a multi-slot flash reader, where the slots map to separate LUNs on a single SCSI ID. Typically only the first slot will be enabled at boot time. Again, this assumes that the flash reader is the first SCSI bus in the system. bsdlabel -w da0 zip100 newfs da0c mount -t ufs /dev/da0c /mnt Write a disklabel to the Zip drive (see vpo(4) for the disktab(5) entry), creates the file system and mounts the new file system on /mnt. newfs_msdos /dev/da0 Create a new FAT type file system. Care should be taken not to run newfs(8) on devices that already contain data, as this will result in the information being lost. Many consumer devices such as digital cameras automatically create MS-DOS based file systems when storing information such as images and videos. These file systems can be accessed by specifying the file system type as msdos when using mount(8). SEE ALSO
ehci(4), ohci(4), uhci(4), usb(4), vpo(4), disktab(5), bsdlabel(8), camcontrol(8) AUTHORS
The umass driver was written by MAEKAWA Masahide <bishop@rr.iij4u.or.jp> and Nick Hibma <n_hibma@FreeBSD.org>. This manual page was written by Nick Hibma <n_hibma@FreeBSD.org>. BSD
October 22, 2009 BSD
All times are GMT -4. The time now is 02:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy