Sponsored Content
Top Forums UNIX for Dummies Questions & Answers finding string in very long file without newlines Post 302410741 by turk451 on Tuesday 6th of April 2010 06:14:32 PM
Old 04-06-2010
What if you just replaced the string with the original string + a newline?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Finding out how long a command takes to run

Hi I am trying to find out the best way to find out how long a command takes to run in miliseconds .. Is there such a way of doing this in Unix ? Thanks (3 Replies)
Discussion started by: cfoxwell
3 Replies

2. Shell Programming and Scripting

Finding a certain string on each line in a file

Hi, I need a script to get every line from a file where there are less then 17 ; on a line. Thank's (5 Replies)
Discussion started by: VODAFUN
5 Replies

3. UNIX for Advanced & Expert Users

finding a string in a file

hi all.. I dont know how to search for a string in a file.. I have tried doing.. I did google but didnt get effective answers..my code is as follows: int search(char* filename,const char* username,const char* passwd) { int flag=0; unsigned long fsize=0; unsigned long current=0;... (2 Replies)
Discussion started by: Ume1986
2 Replies

4. Shell Programming and Scripting

Finding out how long a script runs for and exit reason.

I am running a daemon program that sends texts via a connected mobile phone. I run this daemon via CLI, and it loops a few commands (checking to see if there are any new texts). It runs perfectly, the problem is, when I leave this to run on my Ubuntu Desktop, and come back to it hours later it... (2 Replies)
Discussion started by: daydreamer
2 Replies

5. Shell Programming and Scripting

Need help with finding unique string in log file

Shell script help Here is 3 sample lines from a log file <date> INFO <java.com.blah> abcd:ID= user login <date> DEBUG <java.com.blah> <nlah bla> abcd:ID=123 user login <date> INFO <java.com.blah> abcd:ID=3243 user login I want to find unique "ID" from this log... (3 Replies)
Discussion started by: gubbu
3 Replies

6. UNIX for Dummies Questions & Answers

Finding files with a certain name string inside of another file.

Hi, I have a very large file that contains a listing of all files on the system. I need to create a listing from that file of all files that start with the following format: s???_*, whereas the '?' represents characters, so the file name begins with an 's' followed by three other characters and... (4 Replies)
Discussion started by: tes218
4 Replies

7. Shell Programming and Scripting

Finding a string in a file

Hello All, I have a text file, i want to search for a string in it and the string is repeated multiple times in a file i want to get the first occurence of the string in a variable. the content of file is like: I want to grepthe first occurance of "Configuration flow done" and store the... (7 Replies)
Discussion started by: anand2308
7 Replies

8. UNIX for Beginners Questions & Answers

Finding largest files takes too long

Good evening. because the folder has thousand of files it takes too long and have some trouble to get the largest files and then compress files or delete it, for instance find . -size +10000000c -exec ls -ld {} \; |sort -k5n | grep -v .gz The above commad took an hour and i have to cancel... (10 Replies)
Discussion started by: alexcol
10 Replies

9. UNIX for Beginners Questions & Answers

Finding specific string in file and storing in another file

Text in input file is like this <title> <band height="21" isSplitAllowed="true" > <staticText> <reportElement x="1" y="1" width="313" height="20" key="staticText-1"/> <box></box> <textElement> <font fontName="Arial" pdfFontName="Helvetica-Bold"... (4 Replies)
Discussion started by: aankita30
4 Replies

10. Shell Programming and Scripting

Finding files with newlines in filename

I want to use grep to find files that have newlines in the filename. For example, I have a directory where I create three files: $ touch file1 $ touch "file 2" $ touch "file > with > newlines" $ find . ./file 2 ./file1 ./file?with?newlinesI now want to pipe the find output into grep and... (4 Replies)
Discussion started by: Ralph
4 Replies
mkstr(1)						      General Commands Manual							  mkstr(1)

NAME
mkstr - extract error messages from C source into a file SYNOPSIS
messagefile prefix file... DESCRIPTION
examines a C program and creates a file containing error message strings used by the program. Programs with many error diagnostics can be made much smaller by referring to places in the file, and reduce system overhead in running the program. processes each of the specified files, placing a revised version of each in a file whose name consists of the specified prefix concatenated in front of the original name. A typical usage of would be This command would cause all the error messages from the C source files in the current directory to be placed in the file and revised copies of the source for these files to be placed in files whose names are prefixed with When processing the error messages in the source for transfer to the message file, searches for the string in the input file. Each time it is encountered, the C string starting after the leading quote is placed in the message file, followed by a null character and a newline character. The null character terminates the message so that it can be easily used when retrieved, and the newline character makes it pos- sible to conveniently list the error message file (using etc.; see cat(1) and more(1)) to review its contents. The modified copy of the input file is identical to the original, except that each occurrence of any string that was moved to the error message file is replaced by an offset pointer usable by to retrieve the message. If the command line includes the optional extracted error messages are placed at the end of the specified message file (append) instead of overwriting it. This enables you to process individual files that are part of larger programs that have been previously processed by with- out reprocessing all the files. All functions used by the original program whose names end in that also can take a constant string as their first argument should be rewritten so that they search for the string in the error message file. For example, a program based on the previous example usage would resemble the following: EXTERNAL INFLUENCES
Environment Variables determines the interpretation of comments and string literals as single- and/or multibyte characters. If is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty vari- able. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5). International Code Set Support Single- and multibyte character code sets are supported within file names, comments, and string literals. WARNINGS
Strings in calls to functions whose names end in notably may be replaced with offsets by Calls to error functions whose first argument is not a string constant are left unmodified without warning. SEE ALSO
xstr(1), lseek(2), perror(3C). mkstr(1)
All times are GMT -4. The time now is 08:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy