Sponsored Content
Full Discussion: Delete lines after semicolon
Top Forums Shell Programming and Scripting Delete lines after semicolon Post 302451059 by cola on Sunday 5th of September 2010 01:56:13 PM
Old 09-05-2010
Question Delete lines after semicolon

Code:
char str[MAX]; char str [MAX];
char *ptr; char * ptr;
int CASE; int CASE;
double temp; double temp;

Output should be:
Code:
char str[MAX];
char *ptr;
int CASE;
double temp;

How can i do this with awk,sed,perl?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to delete lines in a file that have duplicates or derive the lines that aper once

Input: a b b c d d I need: a c I know how to get this (the lines that have duplicates) : b d sort file | uniq -d But i need opossite of this. I have searched the forum and other places as well, but have found solution for everything except this variant of the problem. (3 Replies)
Discussion started by: necroman08
3 Replies

2. Shell Programming and Scripting

sed problem - delete all lines until a match on 2 lines

First of all, I know this can be more eassily done with perl or other scripting languages but, that's not the issue. I need this in sed. (or wander if it's possible ) I got a file (trace file to recreate the control file from oracle for the dba boys) which contains some lines another line... (11 Replies)
Discussion started by: plelie2
11 Replies

3. UNIX for Dummies Questions & Answers

How get only required lines & delete the rest of the lines in file

Hiiii I have a file which contains huge data as a.dat: PDE 1990 1 9 18 51 28.90 24.7500 95.2800 118.0 6.1 0.0 BURMA event name: 010990D time shift: 7.3000 half duration: 5.0000 latitude: 24.4200 longitude: 94.9500 depth: 129.6000 Mrr: ... (7 Replies)
Discussion started by: reva
7 Replies

4. UNIX for Advanced & Expert Users

In a huge file, Delete duplicate lines leaving unique lines

Hi All, I have a very huge file (4GB) which has duplicate lines. I want to delete duplicate lines leaving unique lines. Sort, uniq, awk '!x++' are not working as its running out of buffer space. I dont know if this works : I want to read each line of the File in a For Loop, and want to... (16 Replies)
Discussion started by: krishnix
16 Replies

5. Shell Programming and Scripting

search and replace, when found, delete multiple lines, add new set of lines?

hey guys, I tried searching but most 'search and replace' questions are related to one liners. Say I have a file to be replaced that has the following: $ cat testing.txt TESTING AAA BBB CCC DDD EEE FFF GGG HHH ENDTESTING This is the input file: (3 Replies)
Discussion started by: DeuceLee
3 Replies

6. Shell Programming and Scripting

Sed/awk to delete single lines that aren't touching other lines

Hello, I'm trying to figure out how to use sed or awk to delete single lines in a file. By single, I mean lines that are not touching any other lines (just one line with white space above and below). Example: one two three four five six seven eight I want it to look like: (6 Replies)
Discussion started by: slimjbe
6 Replies

7. Shell Programming and Scripting

grep lines separated with semicolon

Hello, I would like to kindly ask you for help. I have a file with some lines in one row separated by semicolon. I need to find out, if the line I have in different variable is included in this file. e.g I have a file foo.txt with lines A=hello there;hello world;hello there world In... (6 Replies)
Discussion started by: satin1321
6 Replies

8. UNIX for Dummies Questions & Answers

Delete a semicolon and numbers after a semicolon

I have this: ((9:0.010,(11:0.089,13:0.004)) and I would like this: ((A9,(A11,A13)) How do I delete the semi colon and the number (i.e. 0.010) after the semi colon? Also, how can I add the letter before the number that is NOT removed? Thank you in advance! ---------- Post updated... (4 Replies)
Discussion started by: MDeBiasse
4 Replies

9. Shell Programming and Scripting

Replace semicolon within double quotes in a file with semicolon delimiter

Hello Team, Could you please help me with the below question? I have a file with the following properties 1) File Delimiter is ; 2) Text columns are within double quotes 3) Numeric columns will not have double quotes 4) File has total 6 columns Please see a sample record from file ... (3 Replies)
Discussion started by: sam99
3 Replies

10. UNIX for Beginners Questions & Answers

Delete multiple lines between blank lines containing two patterns

Hi all, I'm looking for a way (sed or awk) to delete multiple lines between blank lines containing two patterns ex: user: alpha parameter_1 = 15 parameter_2 = 1 parameter_3 = 0 user: alpha parameter_1 = 15 parameter_2 = 1 parameter_3 = 0 user: alpha parameter_1 = 16... (3 Replies)
Discussion started by: ce9888
3 Replies
Ns_ThreadAlloc(3aolserver)				   AOLserver Library Procedures 				Ns_ThreadAlloc(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
Ns_ThreadAlloc, Ns_ThreadCalloc, Ns_ThreadFree, Ns_ThreadMalloc, Ns_ThreadPool, Ns_ThreadRealloc, Ns_ThreadStrCopy, Ns_ThreadStrDup - Mem- ory allocation functions for threads (deprecated) SYNOPSIS
#include "ns.h" void * Ns_ThreadAlloc(size_t size) void * Ns_ThreadCalloc(size_t nelem, size_t elsize) void Ns_ThreadFree(void *ptr) void * Ns_ThreadMalloc(size_t size) Ns_Pool * Ns_ThreadPool(void) void * Ns_ThreadRealloc(void *ptr, size_t size) char * Ns_ThreadStrCopy(char *str) char * Ns_ThreadStrDup(char *str) _________________________________________________________________ DESCRIPTION
These functions are deprecated and are actually wrappers around other functions. You should use the other functions directly. Ns_ThreadAlloc(size) A wrapper for Ns_ThreadMalloc. Ns_ThreadCalloc(nelem, elsize) A wrapper for ns_calloc. Ns_ThreadFree(ptr) A wrapper for ns_free. Ns_ThreadMalloc(size) A wrapper for ns_malloc. Ns_ThreadPool() Deprecated. Always returns a -1. Ns_ThreadRealloc(ptr, size) A wrapper for ns_realloc. Ns_ThreadStrCopy(str) A wrapper for ns_strcopy. Ns_ThreadStrDup(str) A wrapper for ns_strdup. SEE ALSO
nsd(1), info(n), ns_calloc(3), ns_malloc(3), ns_realloc(3), ns_free(3), ns_strcopy(3), ns_strdup(3) KEYWORDS
AOLserver 4.0 Ns_ThreadAlloc(3aolserver)
All times are GMT -4. The time now is 04:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy