Hi,
I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers.
To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
Hello!
I need to delete one line in a file which matches one very precise instance of a string only. When searching the forum I unfortunately only found a solution which would delete each line on which a particular string occurs.
Let's assume I have a file composed of thousands of lines... (4 Replies)
Hello Everyone.
I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below:
if ; then
if ; then
tail +$1 $3 | head -n $2
else
... (5 Replies)
I get a file which has all its content in a single row.
The file contains xml data containing 3000 records, but all in a single row, making it difficult for Unix to Process the file.
I decided to insert a new line character at all occurrences of a particular string in this file (say replacing... (4 Replies)
Hi All,
Can you please guide me to search a string in a particular column of file and return the line number of the line where it was found using awk. As an example :
abc.txt
7000,john,2,1,0,1,6
7001,elen,2,2,0,1,7
7002,sami,2,3,0,1,6
7003,mike,1,4,0,2,1
8001,nike,1,5,0,1,8... (3 Replies)
Hi, i need help with my shell script
I have a file input.txt containing the following contents
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/wine
/usr/share/doc/wine/copyright
/usr/share/doc/wine/changelog.Debian.gz
I need output as
/usr/share/doc/wine
/usr/share/doc/wine/copyright... (3 Replies)
my requirement is,
consider a file output
cat output
blah sdjfhjkd jsdfhjksdh
sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf
hellow there
this doesnt look good
et cetc etc
etcetera
i want to replace a line of line number 4 ("this doesnt look good") with some other line
... (3 Replies)
file 1
abcde,dfgdfg,sdfds
sdfsd,sdfd,sdfg,sdfs
dwfds,sdfgdfg,sdfsdf
file2
1
3
i need to delete the line numbers file 1 based on file2
i have taken in loop file 1 and
i cant able to delete that line number in file 1
Plz help (4 Replies)
Hi Froum.
I have tried in vain to find a solution for this problem - I'm trying to replace any double quotes within a quoted string with a single quote, leaving everything else as is.
I have the following data:
Before:
... (32 Replies)
Discussion started by: pchang
32 Replies
LEARN ABOUT CENTOS
ao_string_tokenize
ao_string_tokenize(3) Programmer's Manual ao_string_tokenize(3)NAME
ao_string_tokenize - tokenize an input string
SYNOPSIS
#include <your-opts.h>
cc [...] -o outfile infile.c -lopts [...]
token_list_t* ao_string_tokenize(char const* string);
DESCRIPTION
This function will convert one input string into a list of strings. The list of strings is derived by separating the input based on white
space separation. However, if the input contains either single or double quote characters, then the text after that character up to a
matching quote will become the string in the list.
The returned pointer should be deallocated with free(3C) when are done using the data. The data are placed in a single block of allocated
memory. Do not deallocate individual token/strings.
The structure pointed to will contain at least these two fields:
tkn_ct The number of tokens found in the input string.
tok_list An array of tkn_ct + 1 pointers to substring tokens, with the last pointer set to NULL.
There are two types of quoted strings: single quoted (') and double quoted ("). Singly quoted strings are fairly raw in that escape char-
acters () are simply another character, except when preceding the following characters:
double backslashes reduce to one
' incorporates the single quote into the string
0fP suppresses both the backslash and newline character
Double quote strings are formed according to the rules of string constants in ANSI-C programs.
string string to be tokenized
RETURN VALUE
pointer to a structure that lists each token
ERRORS
NULL is returned and errno will be set to indicate the problem:
EINVAL - There was an unterminated quoted string.
ENOENT - The input string was empty.
ENOMEM - There is not enough memory. @end itemize
EXAMPLES
#include <stdlib.h>
int ix;
token_list_t* ptl = ao_string_tokenize(some_string)
for (ix = 0; ix < ptl->tkn_ct; ix++)
do_something_with_tkn(ptl->tkn_list[ix]);
free(ptl);
Note that everything is freed with the one call to free(3C).
SEE ALSO
The info documentation for the -lopts library.
configFileLoad(3), optionFileLoad(3), optionFindNextValue(3), optionFindValue(3), optionFree(3), optionGetValue(3), optionLoadLine(3),
optionMemberList(3), optionNextValue(3), optionOnlyUsage(3), optionProcess(3), optionRestore(3), optionSaveFile(3), optionSaveState(3),
optionUnloadNested(3), optionVersion(3), strequate(3), streqvcmp(3), streqvmap(3), strneqvcmp(3), strtransform(3),
2014-06-10 ao_string_tokenize(3)