04-16-2007
anbu23.. it works fine!! But how to handle "new line"
boolean isValid()
{
. . .
}
Any ideas???
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a pipe delimited file I need to add a sequence number to in the third field. The record fields will be variable length, so I have to parse for the second pipe. Another requirement is that the sequence number must be unique to all records in the file and subsequent files created, so the... (5 Replies)
Discussion started by: MrPeabody
5 Replies
2. Programming
Is it possible to add - or edit - data (the strings) contained within the string table of an ELF executable?
I know I can access the string table with the following code;
while ((scn = elf_nextscn(m_elf, scn)) != 0) {
char *name = 0;
gelf_getshdr(scn, &shdr);
... (9 Replies)
Discussion started by: Dhodder
9 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I have file a.txt as below. I want to add one string root beginning of each line.
Sample file a.txt
aaa
bbb
ccc
Sample output
Root aaa
Root bbb
Root ccc
Can any one help me on this? (6 Replies)
Discussion started by: siba.s.nayak
6 Replies
4. Shell Programming and Scripting
I need some help with adding lines to file and substitute a pattern.
Ok I have a file:
#cat names.txt
name: John Doe
stationed: 1
name: Michael Sweets
stationed: 41
.
.
.
And would like to change it to:
name: John Doe
employed
permanently
stationed: 1-office (7 Replies)
Discussion started by: hemo21
7 Replies
5. Shell Programming and Scripting
I have a report file which somewhere has a lines starting with word ".sub"
I have a new variable named $new.
What i am trying to do is insert the content of $new just before the occurrence of ".sub" in the report file.
How can I do that? (11 Replies)
Discussion started by: animesharma
11 Replies
6. Shell Programming and Scripting
I am writing a bash script on ubuntu11.10
I have some string having numbers and letter and want to add all the numbers together
For example
1s2d23f
I want to perform
1 + 2 + 23 and store it in a variable (3 Replies)
Discussion started by: kristinu
3 Replies
7. Shell Programming and Scripting
Hello
I need to add a String after a text in a line. The Unix file is huge and I think nawk would be quick.
Current:
-name FILTER -node 60265 -cob 31/01/2013 -risktype + -change 1 -filter ALL_NODES -toponly -warnings OFF -delimiter "|" -noheader -select... (4 Replies)
Discussion started by: filter
4 Replies
8. Shell Programming and Scripting
Hi All,
please suggest me..
How to add the text from one file to another file and need to add the code after 3 lines of below searched line .
sample code in standard file:
<corecom:Description xml:id="id_2607">
<xsl:value-of... (6 Replies)
Discussion started by: vijayko
6 Replies
9. Shell Programming and Scripting
I have the following string, and want to introduce additional spaces between the two %s. This will be done by specifying the gap between the %s. Example having gap=8 will put 8 spaces between the two %s.
frmt_k1d1_test="%s %s\n"
I am doing the script in bash.
---------- Post updated at... (4 Replies)
Discussion started by: kristinu
4 Replies
10. UNIX for Beginners Questions & Answers
I have an array in an external file, "array.txt", which contains:
char *testarray={"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"};I want to be able to add an element to this array, and have that element display, whenever I call it, without having to recompile... (29 Replies)
Discussion started by: ignatius
29 Replies