Sponsored Content
Full Discussion: Removing lines with sed
Top Forums Shell Programming and Scripting Removing lines with sed Post 302228540 by summer_cherry on Monday 25th of August 2008 02:49:53 AM
Old 08-25-2008
Code:
sed -n -e '/^architecture i386$/{p
n
p
n
p
n
p
n
p
n
p
}' -e '/^architecture ppc$/{p
n
p
n
p
n
p
n
p
n
p
}' file

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sed: removing backticks from certain lines

Hi, I would like to change some lines in my mysql-dump, because there a syntax problems with some version of mysql. I 'd like to change USE ´someDatabase´; to USE someDatabase; (without backticks) using the sed command in the shell Thanks & best regards Bernd (5 Replies)
Discussion started by: bjb
5 Replies

2. Shell Programming and Scripting

Removing lines having #

I have a script which goes to different directories and gives the values of all the input parameters, Something as follows cd /opt grep script-filter = yes *.conf grep user-and-group-in-same-suffix = yes *.conf grep worker-threads = 300 *.conf grep failover-auth = *.conf grep... (9 Replies)
Discussion started by: openspark
9 Replies

3. Shell Programming and Scripting

Removing empty lines(space) between two lines containing strings

Hi, Please provide shell script to Remove empty lines(space) between two lines containing strings in a file. Input File : A1/EXT "BAP_BSC6/07B/00" 844 090602 1605 RXOCF-465 PDTR11 1 SITE ON BATTERY A2/EXT... (3 Replies)
Discussion started by: sudhakaryadav
3 Replies

4. Shell Programming and Scripting

Removing last two lines

I have an awk script that replaces ">" with % %> %< SOURCE", ++i %( PHASE 1", i I use the following script />/ { if ( FNR > 1 ) { print "%)" print "%>" } print "" print "%< SOURCE", ++i (11 Replies)
Discussion started by: kristinu
11 Replies

5. Shell Programming and Scripting

Removing Multiple lines below a keyword using SED?

I have 9,000 + html files. I am using the following to remove the content from a certain line up for i in `ls` do sed '1,569d' $i > $i.bak done This will remove the unwanted formatting keeping the content I need which changes in each HTML file. the problem I have now is that the... (2 Replies)
Discussion started by: deaconf19
2 Replies

6. Shell Programming and Scripting

removing lines without text

How do I remove line that do not contain text, but that do contain tabs? I have tried the command cat file | awk NF but that doesn't work when the lines contain tabs (and spaces). I have also tried: cat file | sed '/^$/d' (9 Replies)
Discussion started by: locoroco
9 Replies

7. Shell Programming and Scripting

Removing blank lines

Hi, my input file is like this I want to remove the blank line. "/home/rit/sandbox/garuda/data/test/woman/T_RITK_F0008_ML_100080039.lab" r a N e l a k sh a m . "/home/rit/sandbox/garuda/data/test/woman/T_RITK_F0008_ML_100070453.lab" a v a s (4 Replies)
Discussion started by: sreejithalokkan
4 Replies

8. UNIX for Dummies Questions & Answers

Removing PATTERN from txt without removing lines and general text formatting

Hi Everybody! First post! Totally noobie. I'm using the terminal to read a poorly formatted book. The text file contains, in the middle of paragraphs, hyphenation to split words that are supposed to be on multiple pages. It looks ve -- ry much like this. I was hoping to use grep -v " -- "... (5 Replies)
Discussion started by: AxeHandle
5 Replies

9. Shell Programming and Scripting

Joining broken lines and removing empty lines

Hi - I have req to join broken lines and remove empty lines but should NOT be in one line. It has to be as is line by line. The challenge here is there is no end of line/start of line char. thanks in advance Source:- 2003-04-34024|04-10-2003|Claims|Claim|01-13-2003|Air Bag:Driver;... (7 Replies)
Discussion started by: Jackceasar123
7 Replies

10. Shell Programming and Scripting

Removing multiple lines from input file, if multiple lines match a pattern.

GM, I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed. I am assuming that sed, awk or even perl could do what I need. I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies
ARCH(3) 						   BSD Library Functions Manual 						   ARCH(3)

NAME
NXGetAllArchInfos, NXGetLocalArchInfo, NXGetArchInfoFromName, NXGetArchInfoFromCpuType, NXFindBestFatArch, NXCombineCpuSubtypes -- get archi- tecture information SYNOPSIS
#include <mach-o/arch.h> extern const NXArchInfo * NXGetAllArchInfos(void); extern const NXArchInfo * NXGetLocalArchInfo(void); extern const NXArchInfo * NXGetArchInfoFromName(const char *name); extern const NXArchInfo * NXGetArchInfoFromCpuType(cpu_type_t cputype, cpu_subtype_t cpusubtype); extern struct fat_arch * NXFindBestFatArch(cpu_type_t cputype, cpu_subtype_t cpusubtype, struct fat_arch *fat_archs, unsigned long nfat_archs); extern cpu_subtype_t NXCombineCpuSubtypes(cpu_type_t cputype, cpu_subtype_t cpusubtype1, cpu_subtype_t cpusubtype2); DESCRIPTION
These functions are intended for use in programs that have to deal with fat files or programs that can target multiple architectures. Typi- cally, a program will use a command-line argument that starts with ``-arch name'', where this specifies an architecture. These functions and data structures provide some help for processing architecture flags and then processing the contents of a fat file. The structure NXArchInfo is defined in <mach-o/arch.h>: typedef struct { const char *name; cpu_type_t cputype; cpu_subtype_t cpusubtype; enum NXByteOrder byteorder; const char *description; } NXArchInfo; It is used to hold the name of the architecture and the corresponding CPU type and CPU subtype, together with the architecture's byte order and a brief description string. The currently known architectures are: Name CPU Type CPU Subtype Description ppc CPU_TYPE_POWERPC CPU_SUBTYPE_POWERPC_ALL PowerPC i386 CPU_TYPE_I386 CPU_SUBTYPE_I386_ALL Intel 80x86 m68k CPU_TYPE_MC680x0 CPU_SUBTYPE_MC680x0_ALL Motorola 68K hppa CPU_TYPE_HPPA CPU_SUBTYPE_HPPA_ALL HP-PA i860 CPU_TYPE_I860 CPU_SUBTYPE_I860_ALL Intel 860 m88k CPU_TYPE_MC88000 CPU_SUBTYPE_MC88000_ALL Motorola 88K sparc CPU_TYPE_SPARC CPU_SUBTYPE_SPARC_ALL SPARC ppc601 CPU_TYPE_POWERPC CPU_SUBTYPE_POWERPC_601 PowerPC 601 ppc603 CPU_TYPE_POWERPC CPU_SUBTYPE_POWERPC_603 PowerPC 603 ppc604 CPU_TYPE_POWERPC CPU_SUBTYPE_POWERPC_604 PowerPC 604 ppc604e CPU_TYPE_POWERPC CPU_SUBTYPE_POWERPC_604e PowerPC 604e ppc750 CPU_TYPE_POWERPC CPU_SUBTYPE_POWERPC_750 PowerPC 750 ppc7400 CPU_TYPE_POWERPC CPU_SUBTYPE_POWERPC_7400 PowerPC 7400 ppc7450 CPU_TYPE_POWERPC CPU_SUBTYPE_POWERPC_7450 PowerPC 7450 ppc970 CPU_TYPE_POWERPC CPU_SUBTYPE_POWERPC_970 PowerPC 970 i486 CPU_TYPE_I386 CPU_SUBTYPE_486 Intel 486 i486SX CPU_TYPE_I386 CPU_SUBTYPE_486SX Intel 486SX pentium CPU_TYPE_I386 CPU_SUBTYPE_PENT Intel Pentium i586 CPU_TYPE_I386 CPU_SUBTYPE_586 Intel 586 pentpro CPU_TYPE_I386 CPU_SUBTYPE_PENTPRO Intel Pentium Pro i686 CPU_TYPE_I386 CPU_SUBTYPE_PENTPRO Intel Pentium Pro pentIIm3 CPU_TYPE_I386 CPU_SUBTYPE_PENTII_M3 Intel Pentium II Model 3 pentIIm5 CPU_TYPE_I386 CPU_SUBTYPE_PENTII_M5 Intel Pentium II Model 5 m68030 CPU_TYPE_MC680x0 CPU_SUBTYPE_MC68030_ONLY Motorola 68030 m68040 CPU_TYPE_MC680x0 CPU_SUBTYPE_MC68040 Motorola 68040 hppa7100LC CPU_TYPE_HPPA CPU_SUBTYPE_HPPA_7100LC HP-PA 7100LC The first set of entries are used for the architecture family. The second set of entries are used for a specific architecture, when more than one specific architecture is supported in a family of architectures. NXGetAllArchInfos() returns a pointer to an array of all known NXArchInfo structures. The last NXArchInfo is marked by a NULL name. NXGetLocalArchInfo() returns the NXArchInfo for the local host, or NULL if none is known. NXGetArchInfoFromName() and NXGetArchInfoFromCpuType() return the NXArchInfo from the architecture's name or CPU type/CPU subtype combina- tion. A CPU subtype of CPU_SUBTYPE_MULTIPLE can be used to request the most general NXArchInfo known for the given CPU type. NULL is returned if no matching NXArchInfo can be found. NXFindBestFatArch() is passed a CPU type and CPU subtype and a set of fat_arch structs. It selects the best one that matches (if any), and returns a pointer to that fat_arch struct (or NULL). The fat_arch structs must be in the host byte order and correct such that fat_archs really points to enough memory for nfat_archs structs. It is possible that this routine could fail if new CPU types or CPU subtypes are added and an old version of this routine is used. But if there is an exact match between the CPU type and CPU subtype and one of the fat_arch structs, this routine will always succeed. NXCombineCpuSubtypes() returns the resulting CPU subtype when combining two different CPU subtypes for the specified CPU type. If the two CPU subtypes can't be combined (the specific subtypes are mutually exclusive), -1 is returned, indicating it is an error to combine them. This can also fail and return -1 if new CPU types or CPU subtypes are added and an old version of this routine is used. But if the CPU sub- types are the same, they can always be combined and this routine will return the CPU subtype passed in. SEE ALSO
arch(1) May 21, 2003
All times are GMT -4. The time now is 06:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy