Sponsored Content
Top Forums Shell Programming and Scripting Find and delete a certain HEX and its following value in a file Post 303012987 by surfi on Tuesday 13th of February 2018 10:42:03 AM
Old 02-13-2018
Question Find and delete a certain HEX and its following value in a file

Hello there,

I've been trying to do this half of the day and it's like I haven't come a single step further, so I hope you guys can help me with my problem:

I have a text file that contains strings that should not be there and which I want to delete automatically from the command line. The character string always consists of two characters, beginning with the hex value "01" (e. g."01 90").

My task is therefore:"search for HEX value 01 and delete this and the following HEX-value". However, I'm too stupid for this task...

Can anyone help me or give me a suggestion which command I need? I've tried tr and sed so far..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find and delete reccuring entries in a file

I have a file with multiple lines, lets say for example magazine1 magazine2 magazine3 magazine3 magazine4 magazine5 So i am trying to find a way to find and delete the duplicate entries. Any ideas? Thanks (3 Replies)
Discussion started by: greekozz
3 Replies

2. Shell Programming and Scripting

find full directory and delete old dated file?

I want to write a code that will look for a particular directory which is full or more than 95% used, and will search older file and delete it. My code looks like this: df -k|while read f1 f2 f3 f4 f5 f6 do if expr '$f5' -ge '95%' || continue then echo $f5 else echo "there is no... (2 Replies)
Discussion started by: xramm
2 Replies

3. UNIX for Dummies Questions & Answers

find and delete a file in one command

hi , let's assume i have a file that is located in the l*** directory and this file's name is t****_***s.php , how can i find this file and delete it using one single command ????? (3 Replies)
Discussion started by: wewee
3 Replies

4. Shell Programming and Scripting

To find a word in a file and delete the file

Hi, I need to find a word in a file, and I need to delete the file where the word resides on the file. I did try with the grep -H "word" using the find command, but no luck. (6 Replies)
Discussion started by: gsiva
6 Replies

5. Programming

After converting the hexstr to Hex and storing the Hex in a char*

Hi All, My main intension of is to convert the Hexstring stored in a char* into hex and then prefixing it with "0x" and suffix it with ',' This has to be done for all the hexstring char* is NULL. Store the result prefixed with "0x" and suffixed with ',' in another char* and pass it to... (1 Reply)
Discussion started by: rvan
1 Replies

6. Programming

What is the difference between ios::hex and std::hex?

Hi, Is there really a difference between these two, std::hex and ios::hex?? I stumbled upon reading a line, "std::ios::hex is a bitmask (8 on gcc) and works with setf(). std::hex is the operator". Is this true? Thanks (0 Replies)
Discussion started by: royalibrahim
0 Replies

7. Shell Programming and Scripting

Find the text in the file and delete the rest of the line.

Hi, I have one requiremnet like this. I need to find some particular string (eg.IncludeDateTime = ) in a file. And wherever it finds the string the unix script has to delete the remaining text coming after the string (ie., 'IncludeDateTime = ' ) in the same line. I tried to write this script in... (5 Replies)
Discussion started by: jannusuresh
5 Replies

8. Shell Programming and Scripting

Find and delete file previous to some date

Hello All, I have a directory containing of many .dat file, but with different naming conventions. I want to delete files which are created before and on 10th September 2013. I tried this command to see files which are are the files created before 10th September find path/to/file -type... (6 Replies)
Discussion started by: nnani
6 Replies

9. Shell Programming and Scripting

Find if file is 45 min old if yes delete

Hello, we have process2(my_pro.sh) which check for the file Pr_rn_Chk (generated by other process1). The process runs every 15 min. if exist Pr_rn_Chk the process will exit. Else it will continue. I want to check if the file Pr_rn_Chk is older than 45 min delete the file. so that 4th run... (3 Replies)
Discussion started by: kumar30213
3 Replies

10. Shell Programming and Scripting

Find and increment value in string of hex

I have a long string of hex (from ASN.1 data) where I need to find and change a particular hex value only and increment it. The hex pairs either side (84 and a7) of the value to increment will remain constant. i.e. "84 <length> <value_to_increment> a7" starting with 00. So end result: ... (11 Replies)
Discussion started by: securegooner
11 Replies
DCCPLSI(1)							  LTP executables							DCCPLSI(1)

NAME
dccplsi - DCCP-based LTP link service input task SYNOPSIS
dccplsi {local_hostname | @}[:local_port_nbr] DESCRIPTION
dccplsi is a background "daemon" task that receives DCCP datagrams via a DCCP socket bound to local_hostname and local_port_nbr, extracts LTP segments from those datagrams, and passes them to the local LTP engine. Host name "@" signifies that the host name returned by hostname(1) is to be used as the socket's host name. If not specified, port number defaults to 1113. The link service input task is spawned automatically by ltpadmin in response to the 's' command that starts operation of the LTP protocol; the text of the command that is used to spawn the task must be provided as a parameter to the 's' command. The link service input task is terminated by ltpadmin in response to an 'x' (STOP) command. EXIT STATUS
0 dccplsi terminated normally, for reasons noted in the ion.log file. If this termination was not commanded, investigate and solve the problem identified in the log file and use ltpadmin to restart dccplsi. 1 dccplsi terminated abnormally, for reasons noted in the ion.log file. Investigate and solve the problem identified in the log file, then use ltpadmin to restart dccplsi. FILES
No configuration files are needed. ENVIRONMENT
No environment variables apply. DIAGNOSTICS
The following diagnostics may be issued to the ion.log log file: dccplsi can't initialize LTP. ltpadmin has not yet initialized LTP protocol operations. LSI task is already started. Redundant initiation of dccplsi. LSI can't open DCCP socket. This probably means DCCP is not supported on your system. Operating system error. This probably means that you are not using an operating system that supports DCCP. Make sure that you are using a current Linux kernel and that the DCCP modules are being compiled. Check errtext, correct problem, and restart dccplsi. LSI can't initialize socket. Operating system error. Check errtext, correct problem, and restart dccplsi. LSI can't create listener thread. Operating system error. Check errtext, correct problem, and restart dccplsi. BUGS
Report bugs to <ion-bugs@korgano.eecs.ohiou.edu> SEE ALSO
ltpadmin(1), dccplso(1), owltsim(1) perl v5.14.2 2012-05-25 DCCPLSI(1)
All times are GMT -4. The time now is 10:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy