Search Results

Search: Posts Made By: ajay41aj
Forum: Programming 03-06-2009
13,669
Posted By ajay41aj
what i did so far....
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main () {
string lineBuffer;
ifstream inMyStream ("c:/File.txt");
if (inMyStream.is_open()) {...
Forum: Programming 03-05-2009
13,669
Posted By ajay41aj
Counting characters, words, spaces, punctuations, etc.
I am very new to C programming.

How could I write a C program that could count the characters, words, spaces, and punctuations in a text file?

Any help will be really appreciated. I am doing...
2,853
Posted By ajay41aj
did u try "s/regexp/replacement/g" ?
did u try "s/regexp/replacement/g" ?
2,301
Posted By ajay41aj
Quick question
When I have a file like this:

0084AF aj-123-a NAME Ajay NAME Kumar Engineer
015ED6 ck-345-c
020B25 ef-456-e
027458 pq-890-p NAME Peter NAME Salob Doctor
0318F0 xy-123-x ...
4,143
Posted By ajay41aj
Thanks for the script. But, I have issues...
Thanks for the script.

But, I have issues when using it when the input file-2 has "test-2" instead of "test-2" or "test-3" instead of "test3" (the use of "-" in other columns.)

So, I am...
4,143
Posted By ajay41aj
I get Output-2 but not Output-1.
I get Output-2 but not Output-1.
4,143
Posted By ajay41aj
:(
hmm, that didn't work :confused:
4,143
Posted By ajay41aj
searching and displaying help
I have two input files like this:

File-1
-----

a1234 abc town
f2345 def village
t5678 pqr county

File-2
------

123456 test1 test2 test3 id-a1234
789012 test2 test4...
3,661
Posted By ajay41aj
wrong output
i get the following output for the awk script :(

6A subject1
8D subject2
E4 subject3
4F subject4
32 subject6
3,661
Posted By ajay41aj
thanks a lot guys... it is of great help. ...
thanks a lot guys...

it is of great help.

cheers,

ajay
3,661
Posted By ajay41aj
No, the data is a sample only, but that is what I...
No, the data is a sample only, but that is what I am trying to achieve.

I could do the first one with no problem (as it is straight forward) and played around with awk, sed, etc, with no success...
3,661
Posted By ajay41aj
File manipulation
Here is the sample input file:

6A subject1 Bldg1
6A subject1 Bldg2 Yes
6A subject1 Bldg3
8D subject2 Bldg1
8D subject2 Bldg2
8D subject2 Bldg3 Yes
E4 subject3...
2,282
Posted By ajay41aj
In your example, I will get no output as there is...
In your example, I will get no output as there is no "kumar" in any lines with "available".

What I need is, I have to look at every line that has "available" in it, extract the first word (ajay,...
2,282
Posted By ajay41aj
Ikon, what i meant is, delete any lines that...
Ikon,

what i meant is, delete any lines that match 'ajay' and 'singh' that are the first field of the lines with 'available' and keep the remaining lines (in the example, lines with kumar in...
2,282
Posted By ajay41aj
string manipulation
i have a file that contains a pattern like this:

ajay 1234 newyork available
kumar 2345 denver
singh 2345 newyork
ajay 3456 denver
kumar 3456 newyork
singh 3456 delhi ...
Showing results 1 to 15 of 15

 
All times are GMT -4. The time now is 10:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy