473,320 Members | 2,097 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Finding the first nonblank character in a string using C++

I have created some code using fstream to extract a string from a file but the string contains many blanks and spaces. an example of the string is:-

E2_PCU_90V "The 90v rail PWM trim value"

I need to print out 'E2_PCU_90V' and 'The 90v rail PWM trim value' as two different strings. I know that I need to find the position of the first non blank and then the position of the first blank and create a string with the contents in between the two markers. Then do then find the first " and the last " and create a second string with the info in between the speach marks.

I am extremly stuck.

Thank you

Lana
Nov 16 '06 #1
1 4556
r035198x
13,262 8TB
I have created some code using fstream to extract a string from a file but the string contains many blanks and spaces. an example of the string is:-

E2_PCU_90V "The 90v rail PWM trim value"

I need to print out 'E2_PCU_90V' and 'The 90v rail PWM trim value' as two different strings. I know that I need to find the position of the first non blank and then the position of the first blank and create a string with the contents in between the two markers. Then do then find the first " and the last " and create a second string with the info in between the speach marks.

I am extremly stuck.

Thank you

Lana
Perhaps you can get ideas here

http://www.thescripts.com/forum/thread564238.html
Nov 16 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Eric Linders | last post by:
Hi, I'm trying to figure out the most efficient method for taking the first character in a string (which will be a number), and use it as a variable to check to see if the other numbers in the...
5
by: lawrence | last post by:
"Garp" <garp7@no7.blueyonder.co.uk> wrote in message news:<_vpuc.1424$j_3.13346038@news-text.cableinet.net>... > "lawrence" <lkrubner@geocities.com> wrote in message >...
10
by: M Bourgon | last post by:
I'm trying to figure out how to find the last whitespace character in a varchar string. To complicate things, it's not just spaces that I'm looking for, but certain ascii characters (otherwise,...
2
by: B Moor | last post by:
I have a database with 100,000's records, each with a unique reference, eg A123BNK456 I would like to generate a search facility whereby we can choose an exact match or partial match, where the...
4
by: David Warner | last post by:
Greetings! In looking into some C coding, I am looking for the C function that will search for multiple occurances of a same character in a string. For Instance: char str = "We the people...
2
by: ElkGroveR | last post by:
Hi there! I'm using PHP to create a simple, dynamic MySQL SELECT query. The user chooses a selection from a HTML Form SELECT element's many options and submits the form via a POST action. ...
1
by: Dilip | last post by:
I have piece of code that breaks apart a string filled with spaces into distinct strings each containing the apporpriate non-whitespace characters using sscanf char encodedsymbol = "IBM RRR...
14
by: prasadjoshi124 | last post by:
Hi All, I am writing a small tool which is supposed to fill the filesystem to a specified percent. For, that I need to read how much the file system is full in percent, like the output given...
2
by: Mick Walker | last post by:
Hi, I am using the following function to match any URLS from within a string containing the html of a webpage: public List<stringDumpHrefs(String inputString) { Regex r; Match m;...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.