Sponsored Content
Top Forums Shell Programming and Scripting remove chunks of text from file Post 302339124 by ryandegreat25 on Wednesday 29th of July 2009 08:14:18 PM
Old 07-29-2009
can you post the input and the desired output as well? this way, you'll get response quickly
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove specified text from file

I am trying to write a script that kills old sessions, I've posted here over the past few days and the script is just about perfect except I want to be given the option to exclude specified PIDs from being killed. this is the entire script: if then rm /tmp/idlepids fi if then rm... (2 Replies)
Discussion started by: raidzero
2 Replies

2. Shell Programming and Scripting

Remove filename is text file

Hello, I got files full path in a text file like that /main/k/kdelibs/kdelibs4c2a_3.5.10.dfsg.1-2ubuntu7_i386.deb /main/k/kdelibs-experimental/libknotificationitem-dev_4.3.2-0ubuntu1_i386.deb /main/k/kdemultimedia/dragonplayer_4.3.2-0ubuntu1_i386.deb... (13 Replies)
Discussion started by: davidkhan
13 Replies

3. Shell Programming and Scripting

Split file into chunks of low & high byte

Hi guys, i have a question about spliting a binary file into 2 chunks. First chunk with all high bytes and the second one with all low bytes. What unix tools can i use? And how can this be performed? I looked in manpages of split and dd but this does not help. Thanks (2 Replies)
Discussion started by: basta
2 Replies

4. Shell Programming and Scripting

Parsing chunks of text and finding data

Hi, I need a script that parses and greps data out of a textfile. I have a text file that has this structure: File1 host1.localdomain text random text Found errors this text is random (41123) --- random random at.5165 ---- random random at.5165 ---- random random at.5165 ----... (2 Replies)
Discussion started by: erick_tuk
2 Replies

5. UNIX for Dummies Questions & Answers

Awk: Print out overlapping chunks of file - rows 0-20,10-30,20-40 etc.

First time poster, but the forum has saved my bacon more times than... Lots. Anyway, I have a text file, and wanted to use Awk (or any other sensible program) to print out overlapping sections, or arbitrary length. To describe by example, for file 1 2 3 4 5 etc... I want the out put... (3 Replies)
Discussion started by: matfald
3 Replies

6. Shell Programming and Scripting

awk for splitting file in constant chunks

Hi gurus, I wanted to split main file in 20 files with 2500 lines in each file. My main file conatins total 2500*20 lines. Following awk I made, but it is breaking with error. awk '{ for (i = 1; i <= 20; i++) { starts=2500*$i-1; ends=2500*$i; NR>=starts && NR<=ends {f=My$i".txt"; print >> f;... (10 Replies)
Discussion started by: mukesh.lalwani
10 Replies

7. Shell Programming and Scripting

Reverse sort on delimited chunks within a file

Hello, I have a large file in which data of names is sorted according to their homographs. The database has the following structure:Each set of homographs with their corresponding equivalents in Devanagari is separated out from the next set by a hard return. An example will make this... (12 Replies)
Discussion started by: gimley
12 Replies

8. Shell Programming and Scripting

Splitting a file into chunks of 1TB

Hi I have a file with different filesystems with there sizes. I need to split them in chucks of 1TB. The file looks like vf_MTLHQNASF07_Wkgp2 187428400 10601AW1 vf_MTLHQNASF07_Wkgp2 479504596 10604AW1 vf_MTLHQNASF07_Wkgp2 19940 10605AID vf_MTLHQNASF07_Wkgp2 1242622044... (4 Replies)
Discussion started by: bombcan
4 Replies

9. Shell Programming and Scripting

Deleting duplicated chunks in a file using awk/sed

Hi all, I'd always appreciate all helps from this site. I would like to delete duplicated chunks of strings on the same row(?). One chunk is comprised of four lines such as: path name starting point ending point voltage number I would like to delete duplicated chunks on the same... (5 Replies)
Discussion started by: jypark22
5 Replies

10. Shell Programming and Scripting

How to remove the text between all curly brackets from text file?

Hello experts, I have a text file with lot of curly brackets (both opening { & closing } ). I need to delete them alongwith the text between opening & closing brackets' pair. For ex: Input:- 59. Rh1 Qe4 {(Qf5-e4 Qd8-g8+ Kg6-f5 Qg8-h7+ Kf5-e5 Qh7-e7+ Ke5-f5 Qe7-d7+ Qe4-e6 Qd7-h7+ Qe6-g6... (6 Replies)
Discussion started by: prvnrk
6 Replies
unlinkb(9F)						   Kernel Functions for Drivers 					       unlinkb(9F)

NAME
unlinkb - remove a message block from the head of a message SYNOPSIS
#include <sys/stream.h> mblk_t *unlinkb(mblk_t *mp); INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). PARAMETERS
mp Pointer to the message. DESCRIPTION
unlinkb() removes the first message block from the message pointed to by mp. A new message, minus the removed message block, is returned. RETURN VALUES
If successful, unlinkb() returns a pointer to the message with the first message block removed. If there is only one message block in the message, NULL is returned. CONTEXT
unlinkb() can be called from user or interrupt context. EXAMPLES
Example 1: unlinkb() example The routine expects to get passed an M_PROTO T_DATA_IND message. It will remove and free the M_PROTO header and return the remaining M_DATA portion of the message. 1 mblk_t * 2 makedata(mp) 3 mblk_t *mp; 4 { 5 mblk_t *nmp; 6 7 nmp = unlinkb(mp); 8 freeb(mp); 9 return(nmp); 10 } SEE ALSO
linkb(9F) Writing Device Drivers STREAMS Programming Guide SunOS 5.10 11 Apr 1991 unlinkb(9F)
All times are GMT -4. The time now is 04:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy