• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 390
  • Last Modified:

My exported CVS file contains equal signs in every field

We use our development tool to export all of our grid boxes to excel.  The issue we are seeing is that when the system automatically loads up the file, every field has an "=" sign in from of the field

='test'
or
='12345555'

yet - when we save the file as a CSV to the desktop, and then reopen it - the equal signs disappear.

thoughts ?

jim
0
Jackson_62
Asked:
Jackson_62
  • 3
  • 2
  • 2
  • +1
1 Solution
 
gfdosCommented:
= is a reserved symbol in excel that means "a formula comes after this"

so essentially each cell when imported is being imported as a formula rather than a value.

nothing to worry about really.
0
 
gfdosCommented:
What are you trying to do here, do you want the "=" to go away?
0
 
Tyler LaczkoCommented:
your fields are being exported as formulas
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
Jackson_62Author Commented:
Yes - the problem is the = is causing each field to look like a formula.  I woudl prefer the = sign does not apaper in the file at all.  The odd thing is some people can export and it looks ok (I have verified excel versions, service packs, etc.) of people runnign the same version of excel and getting different results.

yes - the goal would be to remove the = before it gets to the file.  Again, the oddd thing is when I save the file physically to my computer and reopen it - the '=' signs are gone
0
 
gfdosCommented:
You said "We use our development tool to export all of our grid boxes to excel."
So what is doing the Export --  you need to make sure that isn't exporting them as formulas....
0
 
ReneGeCommented:
Here is my idea on resolving this.

I'm to tired to make sure it's not buggy so if one of you feels like reviewing it, have fun.

Cheers,
Rene

 
@ECHO OFF

SETLOCAL enabledelayedexpansion

SET TempFile=%~n0_%random%.txt
IF EXIST %TempFile% DEL %TempFile%

IF "%~1" == "" (
	REM for test purposes, CSVFile will have the same name as your batch file but with the .csv extension.
		SET CSVFile=%~dpn0.csv
	REM CREATING THE CSV FILE
		ECHO line1,=test>"!CSVFile!"
		ECHO line2,=12345555>>"!CSVFile!"
) ELSE (
	SET CSVFile=%~1
)

REM FIXING THE CSV FILE
	FOR /F "usebackq delims=" %%A IN ("%CSVFile%") DO (
		echo %%A
		SET Line=%%A
		SET Line=!Line:^==!
		ECHO !Line!>>%TempFile%
	)

IF EXIST "%CSVFile%" REN "%CSVFile%" "%CSVFile%.BAK"
IF EXIST "%TempFile%" REN "%TempFile%" "%CSVFile%"

Open in new window

0
 
Jackson_62Author Commented:
gave me a solution fo how to change the formula but did not really help me understand why my development tool kit would be doing this (even when I view the file in notepad and do not see any '=' signs
0
 
ReneGeCommented:
Glad I could help.

At least you have the solution to resolve the simptoms.

Cheers,
Rene
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now