473,487 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

strtok a <tab>

134 New Member
now, i know you can use strtok for many things, like here

Expand|Select|Wrap|Line Numbers
  1. char strxx[]   = "ah-hahaha";
  2. char *first  = strtok(strxx, "-");
  3. char *second = strtok(NULL, "\0");
  4. String yo=first;
  5. String fo=second;
.. but that has nothing to do with it....

what i want to do, is to load a file and subsitute the <tab> character with a new string, but <tab> obviosly means the margin, or whatever its called

FILE:
Expand|Select|Wrap|Line Numbers
  1. 1<tab>2<tab>3<tab>400
and make that automatically turn into

Expand|Select|Wrap|Line Numbers
  1. string a=1;
  2. string b=2;
  3. string c=3;
  4. string d=400;
but, i have had no luck 'strtok'ing a tab character.[and keep in mind that this is being loaded from a file]

thank you
Sep 16 '07 #1
1 3627
sicarie
4,677 Recognized Expert Moderator Specialist
now, i know you can use strtok for many things, like here

Expand|Select|Wrap|Line Numbers
  1. char strxx[]   = "ah-hahaha";
  2. char *first  = strtok(strxx, "-");
  3. char *second = strtok(NULL, "\0");
  4. String yo=first;
  5. String fo=second;
.. but that has nothing to do with it....

what i want to do, is to load a file and subsitute the <tab> character with a new string, but <tab> obviosly means the margin, or whatever its called

FILE:
Expand|Select|Wrap|Line Numbers
  1. 1<tab>2<tab>3<tab>400
and make that automatically turn into

Expand|Select|Wrap|Line Numbers
  1. string a=1;
  2. string b=2;
  3. string c=3;
  4. string d=400;
but, i have had no luck 'strtok'ing a tab character.[and keep in mind that this is being loaded from a file]

thank you
So what is your question? What are you using as the representation of tab character in strtok? Did you try setting a single char variable to '\t'?
Sep 16 '07 #2

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

Similar topics

8
14447
by: Daniel Hansen | last post by:
I know this must seem totally basic and stupid, but I cannot find any reference that describes how to control the spacing between <p>...</p> and <div>...</div> blocks. When I implement these on a...
1
3405
by: Dan Jacobson | last post by:
In wdg-html-reference/html40/block/pre.html there is no mention about how ASCII tabs (^I) are to be rendered. I suppose all bets are off? Wait, my docs go thru html-tidy first, and it says...
21
10900
by: Wladimir Borsov | last post by:
Assume I want to publish a longer article on a web page. One of the paragraphs I want to display with an indent. Read: All text lines of this paragraph should be displayed with (let's say 8) blanks...
6
2412
by: tor | last post by:
Hello How can I use an other key then TAB to move from one textBox to another?? Torfinn
10
6823
by: Brian W | last post by:
Hi All, I have a web user control that, among other things, provides Print this page, and Email this page functionality I have this script that is to execute on the click of the asp:hyperlinks ...
24
3037
by: JB | last post by:
Hi All, This is doing my head in! Please help. I've built a simple <ul> to serve as a menu for a page I'm working on. I have tested the menu in Mozilla Fireworks 1.5 and it's fine - nice and...
1
7274
by: sharmadeep1980 | last post by:
Hi All, I am facing a very unique problem while compling my project in "Release" build. The project is building in DEBUG mode but giving linking error on Release build. Here is the error:...
3
4523
by: laredotornado | last post by:
Hi, Below I have an unordered list that is displayed on the same horizontal plane (thanks for the help yesterday). What I am wondering now is I would like the contents of the DIV with class...
1
2544
by: John B. | last post by:
Please forgive my rant, but trapping keystrokes in .NET couldn't get much worse if someone tried. Sorry to vent my frustration but I've had no end of problems with this for the past 18 months. The...
0
7105
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5439
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4870
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4564
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.