Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7927827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:31:10+00:00 2026-06-03T19:31:10+00:00

I am trying to extract graph information from a text file and converting it

  • 0

I am trying to extract graph information from a text file and converting it to CSV format. The data appears in the format:

    X-axis    Y-axis    dY/dX

which I intend to convert to:

X-axis,Y-axis,dY/dX

It should be noted, however, that the dY/dX column is not always present when exported from the software being used.

The regular expression I have at present is:

\s*(?<xaxis>\-*\d+\.\d+)\s*(?<yaxis>\-*\d+\.\d+)\s*(?<dydx>\-*\d+\.\d+)*

and the replacement expression is:

${xaxis},${yaxis},${dydx}

My question is this: even though the matching expression accounts for the optional nature of the dY/dX column, how can the replacement expression do the same? At present, if the dY/dX column is not present, a trailing comma is printed to the CSV file. I appreciate this is not a major problem, but I would like to know if it is possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T19:31:11+00:00Added an answer on June 3, 2026 at 7:31 pm

    It turns out to not be possible. I have since rewritten the program to store the data first in a DataTable instance, then generate a CSV file from that. That way, the number of columns can be determined and the necessary formatting applied to the output.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to extract data from an xml file. A sample of my code
I am trying to extract telephone word numbers from free text. The general format
I'm trying to extract data from a MySQL server with PHP. The information has
hi i'm trying to extract values from this tagged file here is the file
I'm trying to extract movies metadata (title and year) from their file name. The
I am trying extract some information from the below given string >>> st =
I am trying to extract the content from a gpx file. The problem is
I am trying to extract some meta data from Oracle about foreign keys. I
I'm trying to extract all matches from a EBML definition, which is something like
I'm trying to extract email addresses from plain text transcripts of emails. I've cobbled

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.