Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

some help with a simple RegEX please

  • 21-10-2013 12:23pm
    #1
    Registered Users, Registered Users 2 Posts: 6,253 ✭✭✭


    I've been googling for half an hour, and this apparently simple situation is eluding me; its been a while since I used regexes.

    I have a CSV file with 3 feilds per line, no quotes:
    1. alnum with an embedded space
    2. a signed float (i.e. - before and . within)
    3 an unsigned float

    I'm using Textpad to try to do a regex search/replace, to take out the commas and insert some xml tags in their place

    I tried
    ^[^\,]*[^\,]*[^\,]*$
    but Textpad says it can't find the regex


Comments

  • Subscribers Posts: 1,911 ✭✭✭Draco


    You can live test your regex using Regexpal. Just paste in a few lines of your CSV and it'll show you exactly what your regex matches as you change it. I find it very useful for debuging regexs.


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    http://gskinner.com/RegExr/ is another good one, with a handy reference on the side.


  • Registered Users, Registered Users 2 Posts: 1,109 ✭✭✭Skrynesaver


    bonzodog2 wrote: »
    I've been googling for half an hour, and this apparently simple situation is eluding me; its been a while since I used regexes.

    I have a CSV file with 3 feilds per line, no quotes:
    1. alnum with an embedded space
    2. a signed float (i.e. - before and . within)
    3 an unsigned float

    I'm using Textpad to try to do a regex search/replace, to take out the commas and insert some xml tags in their place

    I tried
    ^[^\,]*[^\,]*[^\,]*$
    but Textpad says it can't find the regex
    Try describing your regex in words, it often illustrates the issue...
    begining of string followed by any number of characters that aren't commas, followed by any number of characters that aren't commas, followed by any number of characters that aren't commas followed by the end of the string....

    Try
    ^[^\,]*,[^\,]*,[^\,]*$
    


  • Registered Users, Registered Users 2 Posts: 6,253 ✭✭✭bonzodog2


    Thanks for your comments and suggestions. I found another way to acheive what I want. I have a sqlite database with latitude/longitude and other data, and wanted to make a KML file to display on Google Earth. I found http://www.convertcsv.com/csv-to-kml.htm very useful.


Advertisement