Replace the Double slash reverse with a single backslash

I'm reading a path of my .ini file. The problem is that when I wrote the path to the .ini file writes with the double backslashes as follows: C:\\My Documents\\a.ini. When I read in there and resave it I get C:\\\My Documents\\\a.ini. I wanted to know if anyone had a way to change C:\\My Documents\\a.ini back to c:\My Documents\a.ini. The-are necessary, because I had to use strcat to some parts of my code. So somehow, I need to find the "------" and replace it with "\". I tried the following, but I get an error when you use "\".

char * p;

While (p = strchr (path, '-'))

*p='\';

Help me please!

It seems that the registration code is doubly unnecessarily each backslash he meets. One possibility would be to change that.

Also note that in C, when you want to specify string constants or a character in your code, some characters must be escaped with a backslash preceding. For example:

newline = "\n" or "\n".

tab = '\t' or '\t '.

apostrophe in a constant digit = "\" "

"string constant quotes ="he said \"hello\.

«= backslash ' \ ' or «»

You see that because the backslash on this special meaning when in a string or character constant, there must also be escaped when you really want just a bar character backslash. That is why, in your example, * p ='\ ' is a mistake. Also, note that in your example, strchr (path, '-') is just the location of any backslash character, not necessarily two back to back. Also realize that if you try to remove characters from a string, just change the character at a given position does not work. I would recommend something like this:

char * fixedPath = malloc (strlen (originalPath) + 1); null value check failed to shorten

for (char * src = originalPath, * dest = fixedPath; 1; ++ src, ++ dest)

{

* dest = * src;

If (* src == '\0') / / end of the source string. break the loop.

break;

If (* src == ' \' & *(src+1) == ' \')

++ src; jumps the extra backslash

}

A. Mert

National Instruments

Tags: NI Software

Similar Questions

  • What is the character of some keyboard shortcuts that resembles a slash reverse, with an equal sign?

    What is the character of some keyboard shortcuts that resembles a slash reverse, with an equal sign?

    Here's something on apple forums:

    Cannot use keyboard shortcuts in Photoshop C... | Apple support communities

  • replace the double forward slashes with a single slash?

    Hello, does anyone know how to remove the double forward slashes and replace them with a simple slash?

    Once, I got this reply, but it did not work:

    function replaceSlash (origText) {}
    Return origText.split("\").join("");
    }

    For example, I got a string variable:
    Hello from the var: String = "Hello"world\nThis is on the second line. "

    If you apply this string to a textfield, you will see the 2 sentence, because the \n is interpertated to a line break.

    But if you use the loaded data as our (with flashvars) I noticed that the debugging panel shows that the
    the data are: world\\n Hello, it's on the second line

    And in my text file external I do not have an extra backslash used... so I don't know why the extra slash is coming, but I don't know that I would take away it. Or that the \n wil be interpreted as escape characters.

    Does anyone know a fix for this?

    Kind regards

    Micheal.


    In fact... in AS2 you could just split on \\n and like the join then with \n
    so:

    function replaceSlash (origText) {}
    Return origText.split("\\n").join("\n"));
    }

    --
    Dave-
    www.offroadfire.com
    Developer leader
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.Adobe.com/communities/experts/

  • Help me to spend the Double slash to the single forward slash in Linux 4.0

    Salvation of DBA

    Very very urgent question

    IAM getting the following error when I apply patch. It shows the way with the double forward slashes that isn't there on my way, but I can go this path of perticular using cd order two ways as simple slash and double slash. Kindly help me to remove that double slashes to slash unique to all records that are complete.



    Error of Administration AD:
    CRP_TOP value does not value of topfile.

    Expected: /s03/NUAT/nuatappl/crp/11.5.0
    Found: /s03/NUAT/nuatappl//crp/11.5.0

    Error of Administration AD:
    WIP_TOP value does not value of topfile.

    Expected: /s03/NUAT/nuatappl/wip/11.5.0
    Found: /s03/NUAT/nuatappl//wip/11.5.0


    Best regards
    SG

    Hello

    Find the file WIP_TOP and CRP_TOP. What "echo $WIP_TOP" and ' echo '$CRP_TOP' of return? Is a customized CRP module?

    Kind regards
    Hussein

  • Cable required to replace the 128 GB SSD with a 500 GB Samsung Sata SSD 600 Evo 850?

    Hello

    I have a Tecra Z50-A-169.

    Do I need a different cable to replace the existing Toshiba 128 GB SSD with a 850 Samsung 500 GB sata SSD 600 EVO?

    V/R

    jvdw

    Nevermind, I found it already.
    The current SSD is located in mSATA and I can directly replace it with a Samsung 850 EVO 500 mSATA

    V/R
    jvdw

  • Replace the screen for one with a higher resolution on Satellite P850-12Z

    Hi all

    I read a lot on the internet about the replacement of the screen on computers laptop toshiba and also I saw a video on [how to replace the screen for a Toshiba Satellite P855 | http://www.youtube.com/watch?v=Ncz3ZaI2I-s].

    Is it possible to replace the screen for a Toshiba Satellite P850 12Z (original: 15.6"@1366x768) to another screen with a higher resolution (say: 15.6"@1920x1080 or 15.6"@1600x900)?

    I'm sure that the graphics card is able to function perfectly with this screen (nVidia GeForce GT630M 2048 MB dedicated) and also I read a lot on laptop screen replacement, and I know that this screen has a connector 40 pin and it is an LED Panel, so I won't have to worry about the ups.

    I found several screens (15.6"@1920x1080) who say they are compatible with Toshiba, but I wan't to make sure a higher resolution Panel replacement is possible.

    Thank you in advance.

    Hello

    Exchange of the display is not supported by Toshiba, so I don't think that someone here can help you with this.
    I assume that Toshiba offers multiple views for this model of laptop. Only seller is different but resolution 1366 x 768 is always the same as on the original laptop specification.

    You can try to contact the nearest Toshiba service provider and ask for help. If someone can help you with that service of Toshiba. They have access to the database of Toshiba and can possibly tell if another view is usable on your machine.

    All this is quite complicated.

  • Replace the chip AMD A8 with an AMD A10

    HI, I was wondering if anyone had any suggestions on this.  I have a HP: 500-054 with an AMD A8 chip, I want to upgrade an A10.  Power and watts on socket are very good A10 uses the same power and is located in the path of upgrade for the Council of Eric on the 054.

    My problem is that it looks like the factory used a thermal GLUE, instead of a paste.  When I opened the hood and went to remove the fan screws were already in bulk.  Unscrew more just to be sure and tried to remove the fan so I could replace the chip. I checked and recheck and nothing else is holds the fan.

    So any suggestions on getting the fan assemble the CPU socket without damaging the motherboard?  He is stuck in solid and hoped that someone here would have a suggestion.

    I'm not particularly intelligent or gifted. I'm just very, very curious.
    Albert Einstein

    Thanks for the reply, I was upgrade the system to pull the max memory and put it into the higher A-series chip. A problem with the fan by pulling even after be unscrewed it wasn't pulling up if I could have access to the chip.

    Regardless of the factory used as a thermal paste should be defined as super glue.  Shouldn't not concerned by the old A8 chip I replaced it anyway, so I unplugged the fan and run the PC for 15 minutes on a game with the unscrewed and disconnected fan.  Not something that I would normally do, but this has worked to build-up of heat allowed me to wiggle the fan a little and she appeared off the coast.

    Thanks for your reply, the problem is resolved and the new chip Assembly and fan of the A10 is installed and works very well.  Note the A8 chip works well so I tested it on another PC so overheating does no damage.

  • replacing the trackpad in 440p with trackpad + track buttons (or keys only) ThinkPad 430

    does anyone know if it is possible to replace the new trackpad without physical buttons on thinkpad 440p with the trackpad + buttons or buttons only (I don't like on the touch button functions)?

    It would be the best final solution to the misconception of the 440p trackpad. !!!

    Thank you

    Piotr

    # It is not possible.

  • Can I replace the motherboard on w510 with

    Hello

    Can I replace motherboard 63Y1495 with 63Y1540 or 63Y1542. It is a w510.

    Recantly, I bought an old w510. The portable freezer randomly and never recoveres. It has been repaired for this before and worked fine for a while. There is no problem, but the motherboard video

    What is your advice? Can I replace the motherboard? Is it a long way? Or is it better to find another laptop?

    According to my notes, 63y1545 is a T510 Board with integrated graphics (Intel). The other 2 boards are W510 boards. They are all the same size and shape, but W510 boards have 4 memory slots and use a different cooling fan. The W510 is a nice machine and worth it if you can get a good price on a Board and fan of fixing. Basic coverage is also different machines 'W', but I don't know if it's important or one you have now.

  • Cannot replace the PXI embedded clock with clock oscillator PXI-6682 on PXI back plane

    I installed a module of synchronization PXI-6682 to slot 2 of a PXI-1031chassis with a PXI-8110 controller running hypervisor and RT.  The 6682 is installed on the RT system hypervisor for GPS sync during the measurements, but I would like to ask the TCXO on the PXI-1031 chassis backplane (which replaces the PXI embedded clock).  When I try to run the "Clock.vi route" that I found in the finder of the example, all I get are error messages indicating that a parameter for this operation is not valid.  The Terminal source is "Oscillator" and terminal of destination is "PXI-Clk10_In"  How can I determine which parameter is not valid?  Any suggestions?  Thank you

    Hi vugt.

    You are right that the physical switch determines which one to use and you should not have to route signals.  If you are having problems with clocks after the synchronization module 6682 please let us know!

  • Replace the layer source footage with After Effects Composition

    Hello!

    I have a question about the workflow of dynamic linking between Premiere Pro and After Effects. As common for most editing workflows, I started by import and organize my source footage. I then cut the entire project using the original footage. Now, as he comes to effects and final optimizations, I noticed that there are several items that I need to work in After Effects.

    I know (and use) the function 'Replace with After Effects Composition', but this only works for an item in the Assembly. I have dozens of clips from same source footage and would simply replace the master-clip with a composition. In this way, I can do the AE-job once that overall the clip and the whole project remains perfectly organized.

    As I read elsewhere, there is no characteristic that makes this replacement directly. Trying to "Replace Footage" with one generates an AE-project error. After Effects render and replace the images with the rendered results (as advised in a similar topic) is no option, given that I'd lose dynamic links in this way. My question is: Y at - it another way or the workaround to replace my source footage of the layer with an After Effects composition?

    Thanks in advance for the help and advice!
    Best regards

    What you can get in the way you want.  Your best option is to export a new clip of the AE and use it to a replace operation in the tray.

    In the future, as a Pseudo-solution you can put the 'AE' in their own, dedicated footage clips and change using these sequences, as if they were real clips.  This would allow you to keep the dynamic link in place.

  • Order of steps, replacing the old program Adobe with the upgrade program

    I just bought 3 copies of the version of windows Adobe Pro XI to replace the Adobe 9 Pro software.  I know that last time I did an update I had problems with the old software.  Initially, I deleted the old software, but the version of upgrade said while I have not had an earlier version.  Rather than delete, I think I should do something with the program.  I tried to read the information on the website I can't find anything on point.  It should be a simple process that I can reproduce at each workstation. Help, please

    You don't need the old installed software but it takes the serial number of the old software - this will be asked as "qualifying product".

    Probably (but not necessarily) find that the installation removes the old version.

  • replaces the former site files with the files edited on the remote server?

    How we replaced the redesign of my website with the old. The revised files are in a new folder on my desktop with a name other than the old files. For the server section to manage sites I click New to enter the same information as the info on my existing site or should I click on edit on the original server info. All information is the same for the location of the remote server, password, user name. The only thing different is the name of the folder where the new files are stored on my computer. Should I move the new files to the folder containing the old files. Help, please. More I read the more confused I became. Thank you. Karen

    It does not matter what drive name or folder you used on your computer.

    What is important is that the structure of the Local site corresponds with that on your remote server.

    Access the Site > Manage Sites > changing the definition of the old site > tell DW where to find the new Site Local folder.  See screenshot.

    Nancy O.

  • Replace the SAS 5i/r with PERC 5i

    We have a SC1435 inherited a new client who has a SAS 5i/r that failed. The customer wants us to try to recover the machine online recoverthe of the 1 73 GB RAID array data.

    With this in mind, we swapped the SAS 5i/r with a PERC 5i we have in our spare parts, in the hope he could read all the metadata in the disks to rebuild the table.

    The drive is detected without problem, but no logical volume is detected.

    Can someone advise on my available options, that is, if I can find an another SAS 5i/r from somewhere it would detect the logical volume, or I have the option to create a new table RAID1 on PERC, but will it hose existing data, or perhaps another option, I did not thought.

    Thanks in advance

    Hello

    SAS 5 only supports migration to another SAS 5, but you should check to see if a foreign configuration is detected on PERC 5 just in case.

    Yes, install another SAS 5 should allow the table to be detected. It is possible that the table has been altered after the failure of the former Comptroller, so a data recovery company may be required if the table is not seen by another SAS 5.

    Thank you

  • Tried to replace the video card integrated with card pci-e x 16 and lost audio - help please

    Is this normal - when you replace your car video with a pci-e video card you would lose your sound.  The system I have is a Pavilion a1450n and has 3 pci slots and 1 pci-e.  I changed the pci-e video in the bios and everything is fine, but no sound at all.  When I took out the card then I would sound.

    Please help.

    The former system of video seems to give me a little trouble.  He keeps hide and freeze from time to time.  Don't know when that will happen.  But when this happens, a blue screen it freezes or just blanks out and comes back.  It will happen nobody knows.  Everything else works fine.  Hate to give up this old gem - for a lot of software installed to lose.

    Thank you all very much for help.

    William

    Hi, William.

    Yes, when you have an old PC where the BIOS does not have HDMI.

    Your PC thinks that you have installed a sound card and a video card because of the HD audio chip on the video card.

    Thus, he disabled the integrated audio system.

    The fix should be easy...

    Go into the BIOS of your PC, look at the options menu and find the onboard audio setting.

    It will be set to auto or off.

    Change the setting to "Enabled". Save the configuration it and yet when you go out (save the settings and exit).

    When you restart, you should have the back of Board.

Maybe you are looking for

  • How can I register on itunes?

    Im trying to sign out of itunes, I already changed my icloud account but it is still asking for my old

  • Start the camera in manual mode?

    If you can make the camera to start immediately in manual mode? Issue edited by Rickard

  • S2815dn will not allow manual entry of numbers of Fax/email

    Howdy! I tried the Dell technical support today with this question and they suggested upgrading the firmware.  However, the firmware downloaded from the printer Dell site says it's impossible to run on my PC (I tried about 10 to win and Win 7). So, a

  • WINDOWS 8 DRIVER FOR MFC - 240 C PRINTER

    I cannot locate the windows print driver 8 for my printer MFC - 240 c.  This printer is compatible with windows 8? I went to the brother download site, but there are no drivers. Thanks for your help.

  • Bulk insert in an external table

    Hi, I get the error ora-29913, ora-01410 trying to do a bulk insert of external tableINSERTIN CORE_TB_LOG(SELECT 'MODEL', 'ARCH_BH_MODEL', ROWID, "MODEL-D-000000001', - 45, 'A', SYSDATE, 'R'")OF ARCH_BH_MODEL1WHERE length (MOD_XCODIGO) > 10)INSERT*ER