Sponsored Content
Top Forums Shell Programming and Scripting Find header in a text file and prepend it to all lines until another header is found Post 303036772 by verdepollo on Wednesday 10th of July 2019 11:41:10 PM
Old 07-11-2019
That worked out beautifully. And yes, the asset name could be any FQDN so no spaces at all. Thanks a lot!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Total of lines w/out header and footer incude for a file

I am trying to get a total number of tapes w/out headers or footers in a ERV file and append it to the file. For some reason I cannot get it to work. Any ideas? #!/bin/sh dat=`date +"%b%d_%Y"` + date +%b%d_%Y dat=Nov16_2006 tapemgr="/export/home/legato/tapemgr/rpts"... (1 Reply)
Discussion started by: gzs553
1 Replies

2. Shell Programming and Scripting

Convert Header into Column in Text file

Hi Gurus, I have a requirement like this and have to create a UX shell scripts. Thanks in advance. File-in: ------ Header2007-12-012007-11-21 100|xyz|was 101|wsa|qws ...... ....... Output should be: ------------------- 2007-12-01|100|xyz|was 2007-12-01|101|wsa|qws ...... .......... (7 Replies)
Discussion started by: vsubbu1000
7 Replies

3. Linux

Reading the header of a tar file(posix header)

say i have these many file in a directory named exam. 1)/exam/newfolder/link.txt. 2)/exam/newfolder1/ and i create a tar say exam.tar well the problem is, when i read the tar file i dont find any metadata about the directories,as you cannot create a tar containig empty directories. on the... (2 Replies)
Discussion started by: Tanvirk
2 Replies

4. Programming

to find header in Mp3 file and retrieve data

hi all, In an mp3 file , data is arranged in sequence of header and data ,how to retrieve data between two headers. Is the data between two headers fixed? because as per theory it says 1152 samples will be there , but dont knw how many bits one sample correspond to? it would help if any c... (2 Replies)
Discussion started by: shashi
2 Replies

5. UNIX for Dummies Questions & Answers

Sort and uniq lines of a file while keeping a header line

So, I have a file that has some duplicate lines. The file has a header line that I would like to keep at the top. I could do this by extracting the header from the file, 'sort -u' the remaining lines, and recombine them. But they are quite big, so if there is a way to do it with a single... (1 Reply)
Discussion started by: Digby
1 Replies

6. Shell Programming and Scripting

how can I bcp out a table into a text file including the header row in the text file

Hi All, I need to BCP out a table into a text file along with the table headers. Normal BCP out command only bulk copies the data, and not the headers. I am using the following command: bcp database1..table1 out file1.dat -c -t\| -b1000 -A8192 -Uuser -Ppassword -efile.dat.err Regards,... (0 Replies)
Discussion started by: shilpa_acc
0 Replies

7. Shell Programming and Scripting

Extract date from file header and prefix it to all lines

Hello All, I have a file in the following format. I want to extract the date(020090930, 020090929) in the string "STPAGE020090930" and "STPAGE020090929" and prefix it to all lines below them. The output must be put into a new file. STPAGE020090930 xyzz aalc... (3 Replies)
Discussion started by: john2022
3 Replies

8. UNIX for Dummies Questions & Answers

Merge all csv files in one folder considering only 1 header row and ignoring header of all others

Friends, I need help with the following in UNIX. Merge all csv files in one folder considering only 1 header row and ignoring header of all other files. FYI - All files are in same format and contains same headers. Thank you (4 Replies)
Discussion started by: Shiny_Roy
4 Replies

9. Shell Programming and Scripting

awk print header as text from separate file with getline

I would like to print the output beginning with a header from a seperate file like this: awk 'BEGIN{FS="_";print ((getline < "header.txt")>0)} { if (! ($0 ~ /EL/ ) print }" input.txtWhat am i doing wrong? (4 Replies)
Discussion started by: sdf
4 Replies

10. Shell Programming and Scripting

Put Header on Text file of all column

Hi I have in put file A.txt ABCDE1 JFHFJFJF3 1 1 SC1 12/10 ABCDE2 JFHFJFJF5 1 1 SC1 12/10 ABCDE3 JFHFJFJF5 1 1 SC1 12/10 ABCDE4 JFHFJFJF6 1 1 SC1 12/10 I want output in .csv with header: Name SUb_N x y No Board ABCDE1 JFHFJFJF3 1 1 SC1 12/10 ABCDE2 JFHFJFJF5 1 1 SC1... (7 Replies)
Discussion started by: pareshkp
7 Replies
PRADS-ASSET-REPORT(1)						    networking						     PRADS-ASSET-REPORT(1)

NAME
prads-asset-report - PRADS Text Reporting Module SYNOPSIS
prads-asset-report -r /var/log/prads-asset.log -w /tmp/asset-report.txt DESCRIPTION
PRADS is a Passive Real-time Asset Detection System. PRADS passively listens to network traffic and gathers information on hosts and services it sees on the network. This information can be used to map your network, letting you know what services and hosts are alive/used, or can be used together with your favorite IDS/IPS setup for "event to host/service" correlation. Gathering info about your hosts in real-time will also let you detect assets that are just connected to the network for a short period of time, where a active network scan (nmap etc.) would take long time, and not common to run continually, hence missing the asset. prads-asset-report parses prads-asset.log prints out some useful information about the hosts prads has managed to gather info about. OPTIONS
-r <file> PRADS Raw Report File -w <file> Output file -i <IP> Just get info for this IP -n Do not convert IP addresses to names. -p Do not convert RFC 1918 IP addresses to names. PROBLEMS
1. Much more logic can be built into it! SEE ALSO
o PRADS <http://prads.projects.linpro.no/> o p0f <http://lcamtuf.coredump.cx/p0f.shtml> o PADS <http://passive.sourceforge.net/> BUGS
Report bugs here: o http://github.com/gamelinux/prads/issues For general questions: o http://projects.linpro.no/mailman/listinfo/prads-devel o http://projects.linpro.no/mailman/listinfo/prads-users AUTHOR
edwardfjellskaal@gmail.com COPYRIGHT
GPL 0.2 2010-06-21 PRADS-ASSET-REPORT(1)
All times are GMT -4. The time now is 09:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy