Programming :: C++: Extracting Data From A NESTED STL Map?

Feb 8, 2011

Code for insertion of data:


#include <map>
#include <iostream>
int main ()


I don't know how to fetch the data from the nested map here.

View 5 Replies


Programming :: Insert Data In A Nested STL Map?

Dec 13, 2010

Following is the declaration:

std :: map <QString, std :: vector <std :: pair <QString, QString> > > configFileDataVector; How should I insert data in it? All the examples which I have looked up in Google are of plain maps!

I tried this, but it failed:


View 4 Replies View Related

Programming :: Methods For Extracting Data Strings From Output Files?

Aug 23, 2010

I am trying to develop a method of reading files generated by other programs. I am trying to find the most versatile approach. I have been trying bash, and have been making good progress with sed, however I was wondering if there was a "standard" approach to this sort of thing. The main features I would like to implement concern reading finding strings based on various forms of context and storing them to variables and/or arrays. Here are the most general tasks:

a) Read the first word(or floating point) that comes after a given string (solved in another thread)

b) Read the nth line after a given string

c) Read all text between two given strings

d) Save the output of task a), task b) or task c) (above) into an array if the "given string(s)" is/are not unique.

e)Read text between two non-unique strings i.e. text between the nth occurrence of string1 and the mth occurrence of string2

As far as I can tell, those five scripts should be able to parse just about any text pattern. I am by no means fluent in these languages. But I could use a starting point. My main concern is speed. I intend to use these scripts in a program that reads and writes hundreds of input and output files--each with a different value of some parameter(s).

The files will most likely be no more than a few dozen lines, but I can think of some applications that could generate a few hundred lines. I have the input file generator down pretty well. Parsing the output is quite a bit trickier. And, of course, the option for parallelization will be very desirable for many practical applications.

View 14 Replies View Related

Ubuntu :: AWK And Extracting Data From Hyperlinks

Mar 29, 2011

I have come across a webpage where there are several (thousands of hyperlinks). Of those hyperlinks, many are named "CDS" and in each of these CDS hyperlink- there are certain lines which i need to chop off!! I kind of have this feeling that AWK would be the one to use.

View 9 Replies View Related

Red Hat / Fedora :: Extracting Data From A Xml File Using C?

Feb 11, 2010

I am trying to extract data from the xml file using c coding. here is the sample code. this code gets compiled with errorfree. but the call back functions start and end are not invoked. coding:



View 1 Replies View Related

Software :: Extracting Cache Data From FF 4.0?

May 27, 2011

well probably most of you have switched to FF 4.0

my major problem with it however , is the way the cache is stored on the hdd , now everything is sort of "sorted" into an endless number of folders.

i'm wondering why did they do it that way ? how are we supposed to browse the cache folders from now?

btw i've always resorted to the cache folder for extracting all kinds of things the browser downloads..

View 7 Replies View Related

Programming :: Access Value From Nested Struct <c Language>?

Mar 11, 2010

I having a nested structures which are referenced with pointer variables :

example :
typedef struct {
int a ;
char *b ;
int *c ;
}EXP2 ;


While trying to access the value of sv.exp2->a it throws segmentation fault error.How to acess this variable ??

View 3 Replies View Related

Programming :: Breaking Out Of Nested Switch Java

Sep 20, 2010

I've only gone into the first case statement of the first switch and I am trying to get out of it but the break statement I added doesn't seem to have any effect and it just goes on to the next case instead of exiting the switch.

import java.util.*;
import javax.swing.*;
public class A2 {
public static void main(String[] args) {
double gross_Pay;
int payment_Method;
final double salary_Pay = 1000.00;
final double hourly_Pay = 25.00;
double overtime1 = 20.00;
double overtime2 = 30.00; .....

View 2 Replies View Related

Debian :: Mounting .iso Image Versus Extracting Data From .img File?

Feb 28, 2010

I use Lenny, and was trying to mount a .iso image, supposedly a cd imagem.


This is what I get from dmesg | tail:

debian:/home/zac/cscd# dmesg | tail
[ 1811.505199] floppy0: disk absent or changed during operation
[ 1811.505207] end_request: I/O error, dev fd0, sector 0


I did a little research on the web and it seems that this file is not really a cd image, but simply data in a .img file. What do you think of that?

debian:/home/zac/cscd# file cscd3.iso
cscd3.iso: data

Some people recommend to extract the data via the dd command, but it didn't seem very safe for me to do that!


is it possible to extract the data into a directory (instead of a device) using dd? This file is supposed to be a software. I wanted to run it on wine by keeping it mounted on a mount point in my file system. Does it make any sense to try to do this if the file simply isn't a cd image?

View 6 Replies View Related

Programming :: [ Bash ] Count Nested HTML Tags?

Jan 7, 2011

I need to search through HTML files to count the number of <li> tags nested within the first <ul> tag:

<li>text 1</li>
<li>text 2</li>


Unfortunately, the second grep is greedy swallowing everything up to the last </ul> close tag. (The desired result is 2.) Speed is an issue as I will be searching through 350,000 files.

View 14 Replies View Related

Programming :: Passing An Enum Value To A Nested Class Constructor C++?

Jun 18, 2011

the compiler (g++ 4.4.5) does not recognize PRE as a type in the following code:

enum mode {PRE, IN, POST};
class tree


View 9 Replies View Related

Programming :: Getting Closer To The Answer - Python Iterations Over Nested Tuples?

May 22, 2010

tupe=("File",("Open","Open a file"),"Edit",("Cut","Cut a file"),("Paste","Paste a file"),"About",("About","About the program"))
for items in tupe:
if type(items)==str:


I'm trying to understand how to make "File" be the parent information for "Open","Open a file" and "Edit" to be the parent of "Cut, Cut a file" and "Paste", "paste a file". Does anyone have a suggestion for accessing the a nested tuple in this manner? The above code does not quite do what I want it to. The above code is for visual purposes, but I'm learning how to refactor for wx.python.

View 3 Replies View Related

Programming :: Nested Loop Using A Counter To Increment Array Output?

Feb 2, 2011

I work in a simulations environment. I'm trying to write a bash script that will read fields from a .csv file into an array, the first field being an identifiyng number and the second field being a corresponding url. There are about 1600 of these number/url combinations in the .csv file that i'm reading from. Once that is done i want it to parse a text file and match the number, when it has a match i want it to enter the corresponding url into a particular line in the text file. The script I have written (with the help of the people on this forum a while back) does this well, but now I have a lot more data to parse. I think the script itself is explanatory enough to see what i'm doing. What i would like to do is cut it down to one while loop nested inside another loop so that I don't have 1600 or so elif statements. I can't figure out how to increment the output of the array. for instance, the first cycle would find the number that matches ${record1[2]} and input the url stored in ${record1[3]}. the next cycle would match ${record1[4]} and input the url in ${record1[5]}, and so on, does that make sense? The code is below and a sample .csv and text file are attached.


View 14 Replies View Related

Programming :: Extracting URLs From Strings?

Jun 28, 2009

I have a PHP script written that is checking a string to see if it contains a link in it (i.e. a URL). I have the following if statement, that uses 3 possible regular expressions to determine if there is a link or not.

// check if we found a link
// links are denoted by strings that:
// - contain http://
// - contain www.*.*


I'm not convinced yet that writing a shell script to do this is the best course of action. If someone is capable of doing this with a Perl or a Python script that's fine too. If you want to make it super high performance and write it in assembly

View 1 Replies View Related

Programming :: Extracting Columns In Particular Order?

Jun 9, 2010

Say I have a text file with10 columns. I need to reorder them based on a list of column numbers that will reorder them.

My problem is this:

If I want to cut out 5 columns (columns 1,2,3,9,10) in the order 1,10,2,9,3 then I have tried using:

Code: cut -f1,10,2,9,3 my_file.txt > reordered_file.txt But this just extracts the columns in order as if I used:

Code: cut -f1,2,3,9,10 my_file.txt > reordered_file.txt How can I cut these columns and place them into the new file in the order I specify?

While this might seem quite trivial, I will actually need to do this for a file containing ~14000 columns with ~12000 columns that I need to extract in a particular order.

View 2 Replies View Related

Programming :: Extracting Integers From A String?

Nov 8, 2010

I have a string, like file223a3b5. How can I extract the number beginning after "file" and ending before "a"?

View 3 Replies View Related

Programming :: Extracting Block Of Text From Log File?

Nov 22, 2010

I have a log file and want to extract all blocks of text that start with START and ends with END. Each block is 5 lines.

blah blah blah


View 1 Replies View Related

Programming :: Extracting Auditing Info Using Awk System And Ausearch?

Aug 25, 2010

I'm a linux newbie and scripting novice and I'm trying to pull auditing info and dump it into a file. I made some login changes so it would get audited but I don't want to have to sift through the log to see who the user was and what was done. This is what I have below here and I can't seem to get it to extract the info want using the event id. The "ausearch -a $10" from the script should get it from the 10th column but it's not working.If I can get this to work I would like to add additional aureport options.

yyyy=`date "+%Y"`
mm=`date "+%m"`


View 6 Replies View Related

Programming :: Extracting Last Section Of File (Separated By Hashes)

Feb 22, 2011

I have a file which looks something like this:

text also includes empty lines

Basically all sections are separated by 10 hashes and I need to somehow only print all lines in the last section (the "some more text" part in the example above"). I tried all kind of things with sed and awk but I didn't find any way to identify the last "section".

View 8 Replies View Related

Programming :: Searching Thunderbird Emails & Extracting Information

Jun 8, 2010

I have a load of emails in my Thunderbird trash folder and some of them (all with a similar subject) I want to extract the email address for them and put in a text file. I have located the trash file but it seems that it is just a big flat file with a concatenation of all my emails in it, varying number of header lines etc etc - ie, something which really doesn't seem to suit awk, sed, grep etc.Does anyone know of any way this might be accomplished, or any third party tools which may help?

View 1 Replies View Related

Programming :: Get Data From Serial Port Function Read() Blocks When Data Not Available?

Jun 11, 2009

I am using read() in c++ to get data from a serial port. However, if no data is available on the serial port the function blocks until dta arrives.Example code:

char m_readBuffer[255] = {0};
char* p_curChar = m_readBuffer;


View 1 Replies View Related

Programming :: Data Directory In Automake - Data Is Always Read-only ?

May 9, 2010

I have some data files that should be distributed with my program. Using dist_pkgdata_DATA in, I get these files installed to /usr/local/data/share/package-name. The problem is that data is read-only, and my program needs to modify it. Playing with dist_sharedstate_DATA, dist_localstate_DATA, dist-data_DATA varibles, I got different installation directories, like /usr/local/com, usr/local/var, but data is always read-only.

How can I distribute modifiable data files with my package? I need some common directory for all users, or maybe local data in a user directory.

View 1 Replies View Related

Programming :: Convert The String Data Type To Other Primitive Data Type?

Mar 4, 2011

I am trying to generic way to convert the string datatype to other primitive data type. To achieve, i used Template . But i getting error and couldn't resolve the issue and error reported is also clueless.

#include <vector>
#include <iostream>
#include <string>


View 7 Replies View Related

Fedora :: Thunderbird - Cut Parts Of Nested Quotes?

Jun 24, 2011

In Thunderbird, when composing a reply to an email that you have quoted, is there a way to cut only part of the quoted material? A typical situation is that you have exchanged a series of emails with someone and your reply has all the old emails from your and the otherperson quoted in it. The quotes are nested inside each other. Often I'd like to chop off all the very old messages and just leave the last few. But the Thunderbird editor seems to make it an all-or-nothing proposition. I can cut the whole quote, but can't highlight a few nested parts and cut them.

View 3 Replies View Related

General :: Mutt Nested Mailboxes Navigation Possible?

Feb 18, 2010

I receive a lot of emails daily, and with the ever-growing amount of maildirs I'm in need to structure/optimize the browsing in mutt. My maildirs follow this naming scheme: .domain.category.sub_category

My goal is to break domain, category and sub_category into nested levels when browsing through the mailboxes. This is sort of achieved through the use of imap. But I stumble upon a few snags, so my questions are:

Is this nested mailboxes view possible by directly accessing ~/Mail and not using IMAP?
E.g. set folder="~/Mail" and set spoolfile="~/Mail/.INBOX"
When I start mutt I'm presented with all mailboxes available, which is what I want to get away from. I want to get directed directly into my default/main inbox like I do when accessing ~/Mail directly. How?

When hitting c (a defined macro, see configuration below) I again get presented with all the mailboxes available, and not the mailboxes at the current browsing level, e.g. mailboxes containing a specific category. To get this view I need to hit c+TAB. I've solved this by adding a <tab> to the c macro's. When finally getting mutt to present me mailboxes in nested levels they are only enumerated and not annotated with N, indicating new mail, or even better, total number of new mails in or under a folder. I know it's possible to define format on the different views, but is there one for this view? If so, which?

My mutt configuration:
set autoedit
set edit_headers
set reverse_name
set from='blapp'
set realname='Blapp'
set use_from .....

# Automatic viewing of html mail, but always prefer text/plain
set implicit_autoview
alternative_order text/plain text/html

View 1 Replies View Related

General :: List Of All Nested Subfolders With A Specific Name?

Jun 3, 2010

How to get a list of all the subfolders with a specific name
e.g. all the folders which their name contains 'NAME' code...

but this won't give me a unique list (if the folder has subfolders it gets listed multiple times)

View 1 Replies View Related

Ubuntu :: Terminal Deeply Nested Folder

Jun 4, 2011

i was wondering what's the fastest way to access a deeply nested folder.

is there a way to 'cd' to the most nested folder given that i know the folder name?

View 4 Replies View Related

Server :: Create Nested Raid In Centos?

Jan 21, 2010

We can create normal raid levels in centos using mdadm, but how can we create nested raid levels ( example raid 1+0 Raid 0+1).

View 2 Replies View Related

Ubuntu :: Importing Nested Mail Folders To Evolution?

Nov 9, 2010

Just installed latest Ubuntu (dual boot with XP until settled in) and also installed Evolution as default mail client. All works well. But, I need to import my nested, hierarchical mail folders (over 200) from Thunderbird on XP in to Evolution. Is there any speedier and less laborious way than importing single mail folders and then having to re-arrange them all?

View 2 Replies View Related

General :: Nested Loop-bash Script - On Logic?

May 30, 2010

Am new in bash scripting, presently I have 2 files and i need to create a file reading from these 2 files. I was trying to work with 2 for loops, but I can see like once its executing 1st outer loop then all inner loop, then next outer loop+ all inner loop. How can i get result like 1 outer loop, 1 inner loop then 2 outer loop,2 inner loop etc. Below is my prog

rm d
for i in `cat a`
echo "dn:$i >> d
for j in `cat b`


View 6 Replies View Related

Copyrights 2005-15, All rights reserved